如何从ExtJS Store检索JSON数据 [英] How to retrieve JSON Data Array from ExtJS Store

查看:144
本文介绍了如何从ExtJS Store检索JSON数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法允许我将我的存储数据返回到ExtJS网格面板中,其方式是使用以下方式加载:

Is there a method allowing me to return my stored data in an ExtJS Grid Panel exactly the way I loaded it using:

var data = ["value1", "value2"]
Store.loadData(data);

我想要一个用户选项来重新加载网格,但是对商店的更改需要考虑到用户可以进行更改并且网格是动态更新的,但是如果我重新加载网格,即使数据库已使用新更改进行更新,也会显示最初加载的数据。我不想重新加载页面,只需让他们使用新更改的商店重新加载网格数据。

I would like to have a user option to reload the Grid, but changes to the store need to be taken into account. The user can make changes and the grid is dynamically updated, but if I reload the grid, the data that was originally loaded is shown even though the database has been updated with the new changes. I would prefer not to reload the page and just let them reload the grid data itself with the newly changed store.

我想要找这样的东西:

var data = Store.getData();
//data = ["value1", "value2"]

并做了。或者有不同的方式来刷新网格,我不知道的新数据。即使使用代理仍然使用原始数据,而不是新的商店。感谢提前

after its all said and done. Or is there a different way to refresh the grid with new data that I am not aware of. Even using the proxy still uses the "original" data, not the new store. Thanks in advance

推荐答案

Store.getRange() 似乎正是您正在搜索的内容对于。它将返回您 Ext.data.Record [] - 记录数组。如果没有参数被传递,则返回所有记录。

Store.getRange() seems to be exactly what you are searching for. It will return you Ext.data.Record[] - array of records. If no arguments is passed, all the records are returned.

这篇关于如何从ExtJS Store检索JSON数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆