dojox.grid.DataGrid中没有数据显示 [英] No data showing in dojox.grid.DataGrid
问题描述
我正在使用dojo 1.3,并且在获取这个dojox.grid.DataGrid的问题上有问题。我相信这是我的无知。我一直在阅读Dojo校园的例子,并且beleive我是对的。我的html看起来像:
I am using dojo 1.3 and having problems getting this dojox.grid.DataGrid working. I am sure it is my ignorance. I have been reading over the Dojo Campus examples and beleive I have right. My html looks like:
<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>
firebug显示从数据存储返回的数据为:
The firebug showes the data returned from the datastore as:
{identifier:"ID",items:[{"ID":"1","description":"Test Forum","title":"Test","topics":[],"commentCount":"0"}]}
渲染我得到列表列,但没有数据显示。我错过了一些明显的东西吗?
When the content is rendered I get the table columns listed but there is no data displayed. Am I missing something obvious?
谢谢
推荐答案
绝对不是你的错尝试从以下位置更改表格上的样式:
This one is definitely not your fault. Try changing the style on your table from:
style="width: 100%; height: 100%;"
如下所示:
style="width: 900px; height: 300px;"
我不知道它是如何工作的,但我发现网格代码几乎不可用,因为东西喜欢这个。我的喜好太多功能
I am not sure how it works inside, but I find the grid code is almost unusable because of stuff like this. Too many "features" for my liking.
我希望这适用于你,它在1.2.3版修复了它。
I hope this works for you, it fixed it for me on version 1.2.3.
这篇关于dojox.grid.DataGrid中没有数据显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!