【发布时间】:2011-07-29 07:18:10
【问题描述】:
在支持数据网格的存储上调用 newItem() 然后 save() 后,DataGrid 没有自行解决问题。
<div dojoType="dojo.data.ItemFileWriteStore" url="/MultiRaterManagerAjax" id="mrWriteStore" jsId="mrWriteStore"</div>
<table dojoType="dojox.grid.DataGrid" region="left" query="{ hasSub: false }"
clientSort="true" selectionMode="single" jsId="ldrSubGrid" sortInfo="1"
errorMessage="Loading..." store="mrWriteStore">
<thead>
<tr>
<th width="100%" field="_item" formatter="formatSubs">Subs</th>
</tr>
</thead>
</table>
事件处理程序调用以下 javascript
item = mrWriteStore.newItem({});
//set the necessary attributes on item
mrWriteStore.save({onComplete:afterStoreUpdate, onError: saveFailed});
一个新项目被添加到商店,DataGrid 更新显示新项目。但新项目位于列表的底部。它似乎无法识别数据网格的排序顺序。
我在想我需要在数据网格上连接(或订阅)一个事件,告诉我它已经更新了数据。然后在触发此事件时调用排序/过滤函数。但是要连接/订阅什么?
【问题讨论】: