【发布时间】:2011-10-18 20:24:44
【问题描述】:
我正在使用 Dojo 1.6 并尝试使用 Ajax 使用新数据更新 Html-Store。存储连接到 DataGrid,并且在第一次显示数据时它可以工作。但是当我更新商店时,数据网格中的行消失了(标题仍然存在)。
有趣的是它在 Firefox 5 和 GoogleChrome 12 中有效,但在 InternetExplorer 9 和 Opera 11.5 中无效
//the Ajax call just the data in this table
<table id="dataTableId" style="display: none;">
//... the data here ...
</table>
<span dojoType="dojox.data.HtmlStore" dataId="dataTableId" trimWhitespace="true" jsId="storeId" />
<table dojoType="dojox.grid.DataGrid" store="storeId" query="{}" jsId="grid" selectionMode="single"> </table>
JS 更新函数:
function updateStore(){
var newStore = new dojox.data.HtmlStore({dataId: 'dataTableId'});
grid.setStore(newStore);
//these 2 don't have any effect:
newStore.update();
newStore.fetch();
}
更新网格后,我还在 Firefox 和 InternetExplorer 中检查了 Html-Code:
InternetExplorer-HtmlCodeView
<div class="dojoxGridScrollbox" role="presentation" style="height: 585px;" dojoAttachPoint="scrollboxNode">
<div class="dojoxGridContent" role="presentation" style="width: 535px; height: 1px;" hideFocus="hidefocus" dojoAttachPoint="contentNode" />
// in the above div all the data-rows should be (see the Firebug output below)
</div>
Firefox-Firebug
<div role="presentation" dojoattachpoint="scrollboxNode" class="dojoxGridScrollbox" style="height: 270px;">
<div role="presentation" hidefocus="hidefocus" dojoattachpoint="contentNode" class="dojoxGridContent" style="height: 168px; width: 535px;">
//... all the data-rows here ...
</div>
</div>
你们中有人知道我可以尝试什么或我做错了什么吗?提前致谢!
【问题讨论】:
标签: internet-explorer datagrid dojo