首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >spring-roo dojox.grid.DataGrid未呈现

spring-roo dojox.grid.DataGrid未呈现
EN

Stack Overflow用户
提问于 2010-04-21 23:04:21
回答 1查看 2.4K关注 0票数 0

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

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-06-08 01:48:22

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

代码语言:javascript
复制
<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>

我使用了这个,它也是有效的:

代码语言:javascript
复制
<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>

在我的应用程序中,我也与我的全局css发生了冲突,我使用高度: 999px而不是100%来解决这个问题。

代码语言:javascript
复制
 <table dojoType="dojox.grid.DataGrid" store="store1"
                query="{ Title: '*' }" clientSort="true"
                style="width: 100%; height: 999px;" rowSelector="20px">
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2684114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档