2
我在调用newItem()然后在支持数据网格的商店上保存()后没有自动执行操作的DataGrid出现问题。Dojo 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,它告诉我它已经更新了数据。然后当这个事件被触发时我调用排序/过滤函数。但是连接/订阅什么?
这是为排序工作。谢谢。我不认为商店里的事件会是我想要在网格上分类的。在同样的情况下仍然存在过滤问题,但我还不知道提问的问题。 onComplete:ldrSubGrid.filter({hasSub:false,},null);没有做任何事情,但在Firebug正确过滤网格后,运行相同的代码。有时JavaScript很笨拙。 – srock 2011-04-06 15:26:36
它是否包裹在这样的功能? onComplete:function(){ldrSubGrid.filter({hasSub:false,},null); }只是检查确认 – 2011-04-06 16:13:46