我想在调用函数时而不是声明时在 dGrid 中动态设置存储。 是否可以?在 dataGrid 中我使用
gridId.setStore(newStore);
dojo 中的 dGrid 有类似的东西吗?
我检查了所有 api 和文档,但仍然没有结果。
最佳答案
dgrid 遵循与 Dijit 相同的模式,具有中央 set
和 get
方法,而不是单独的公共(public) setFoo
和 getFoo
code> 为每个属性调用的方法。因此,您可以调用 set('store', newStore)
,而不是 setStore(newStore)
。 (相比之下,dojox DataGrid 的 API 遵循自 Dojo 1.4 以来已弃用的模式。)
这在 dgrid 的 documentation 中有介绍。以及 Grids and Stores tutorial .
关于javascript - 如何动态设置store dojo dgrid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25176087/