开发者

Dojo itemfilewritestore delete reference

When using the deleteItem function to remove an item from f.ex. a dijit tree, all items with the same id are deleted. Is there any way to only delete one item an开发者_开发问答d not its references?


The dijit tree requires that you have unique identities in your data store to the best of my knowledge. Perhaps you need to look at the your json data feed and come up with an unique id?

Below is a simple snippet I use to delete items from my tree data store.

treeStore.fetchItemByIdentity({
   identity: myUniqueid,
   onItem: function(item) {
      treeStore.deleteItem(item);
   }
});

I then call treeStore.Save(); which applies the delete back to the server. The Tree should be listening to the store for changes and update accordingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜