【问题标题】:spring-roo dojox.grid.DataGrid not renderedspring-roo dojox.grid.DataGrid 未呈现
【发布时间】:2010-04-21 15:04:21
【问题描述】:

我正在使用 spring-roo 来尝试使用 dojox.grid.DataGrid。该页面呈现为一个普通的表格。为什么它不使用 DataGrid? 谢谢! 史蒂夫

<div xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"><jsp:output
omit-xml-declaration="yes" /> <script type="text/javascript">
dojo.require("dijit.TitlePane");
</script> <script type="text/javascript"
src="&lt;c:url value=&quot;/resources/dojo/dojo.js&quot; /&gt;">

</script> <script type="text/javascript"
src="&lt;c:url value=&quot;/resources/spring/Spring.js&quot; /&gt;">

</script> <script type="text/javascript"
src="&lt;c:url value=&quot;/resources/spring/Spring-Dojo.js&quot; /&gt;">

</script> <script type="text/javascript">
dojo.require("dojox.grid.DataGrid");
dojo.require("dojox.data.CsvStore");
</script>

<div id="_title"><spring:message var="app_name"
code="application.name" /> <spring:message var="title"
code="welcome.titlepane" arguments="${app_name}" /> <script
type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration( {
    elementId : '_title',
    widgetType : 'dijit.TitlePane',
    widgetAttrs : {
        title : '${title}'
    }
}));
</script>

<h4>Title</h4>
<table dojoType="dojox.grid.DataGrid">
<thead>
    <tr>
        <th field="fieldName" width="200px">Column Name</th>
        <th field="fieldName" width="200px">Column Name</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>test1</td>
        <td>test2</td>
    </tr>
    <tr>
        <td>test3</td>
        <td>test4</td>
    </tr>
</tbody>
</table>
</div>
</div>

【问题讨论】:

    标签: jsp dojo spring-roo


    【解决方案1】:

    http://docs.dojocampus.org/dojox/grid/DataGrid#required-css 的文档说你需要这个 css:

    <style type="text/css">
        @import "/moin_static163/js/dojo/trunk/dojox/grid/resources/Grid.css";
        @import "/moin_static163/js/dojo/trunk/dojox/grid/resources/tundraGrid.css";
        .dojoxGrid table { margin: 0; } html, body { width: 100%; height: 100%;
        margin: 0; }
    </style>
    

    我用过这个也很管用:

    <link rel="stylesheet" type="text/css" href="script/dojox/grid/resources/Grid.css" />
    <link rel="stylesheet" type="text/css" href="script/dojox/grid/resources/tundraGrid.css" />
    <style type="text/css">
        .dojoxGrid table { margin: 0; } html, body { width: 100%; height: 100%; margin: 0; }
    </style>
    

    在我的应用程序中,我还与我使用 height: 999px 而不是 100% 修复的全局 css 发生冲突。

     <table dojoType="dojox.grid.DataGrid" store="store1"
                    query="{ Title: '*' }" clientSort="true"
                    style="width: 100%; height: 999px;" rowSelector="20px">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-09
      • 1970-01-01
      • 1970-01-01
      • 2019-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多