我正在使用dojo 1.3,并且在获取此dojox.grid.DataGrid工作时出现问题。我相信这是我的无知。我一直在阅读Dojo校园的例子,并相信我是对的。我的HTML看起来像:在dojox.grid.DataGrid中没有数据显示
<script type="text/javascript">
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
</script>
<div dojoType="dojo.data.ItemFileWriteStore" jsId="forumsStore" url="action/forum.JsonForums"></div>
<div id="ForumsListingArea" name="ForumsListingArea">
<div id="ListOfForumsContainer" name="ListOfForumsContainer">
<table dojoType="dojox.grid.DataGrid" query="{ID:'*'}" store="forumsStore" clientSort="true" style="width: 100%; height: 100%;" id="ListOfForums" name="ListOfForums">
<thead>
<tr>
<th field="title" width="200px">Title</th>
<th field="commentCount" width="200px"># Of Posts</th>
<th field="description" width="200px">Moderators</th>
<th width="200px">Del|Config</th>
</tr>
</thead>
</table>
</div>
</div>
萤火showes从数据库返回的数据:
{identifier:"ID",items:[{"ID":"1","description":"Test Forum","title":"Test","topics":[],"commentCount":"0"}]}
当内容呈现我得到的表列中列出,但没有显示的数据。我错过了明显的东西吗?
谢谢
你是否在暗示我正在为自己设置更多的问题?很容易就可以自己剔出行列表。 – Mark 2009-11-02 14:56:05
声明式字段绑定增加了相当多的价值,所以我不会说它不值得头痛。我想这取决于你展示的数据的性质以及你需要如何表现网格。 另一个问题:网格单元必须完全相同的高度。在大多数网格中,情况就是如此(一行文本)。但对于我的用例,我有一行是一段文字,每一行都有不同的大小。当您向下滚动一个大列表时,这会导致一些奇怪的行为。调试并不容易。 – tommyjr 2009-11-02 16:01:28
我一整天都在b my自己的脑袋,突然出现了'style =“width:900px; height:300px”',并且它出现了。如果不是为了在Dojo中实现良好的集成,而且丰富的用户界面和数据存储,更不用说国际化了,那么我会离开道场。 – asdacap 2011-12-03 15:29:39