简体   繁体   English

ExtJS 4.2如何获取视图的所有存储?

[英]ExtJS 4.2 How can I get all the stores of a view?

I´m trying to obtain all the stores of a view in a controller. 我正在尝试获取控制器中视图的所有存储。 For example my view is a panel that has 2 grids and 4 combos,every one has his own store. 例如,我的观点是一个具有2个网格和4个组合的面板,每个面板都有自己的商店。 Is there a way to obtain all the stores using Ext.ComponentQuery or something like this.Ext.StoreManager returns all the stores of the app,I only want the stores of a specific view. 有没有一种方法可以使用Ext.ComponentQuery或类似的东西来获取所有商店。Ext.StoreManager返回应用程序的所有商店,我只想要特定视图的商店。

If you have a component that does have a store that is not bound using the store property, bad luck. 如果您的组件确实具有未使用store属性绑定的store ,那么运气不好。 But if you are only working with basic ExtJS components like grid and combo, you may try whether 但是,如果仅使用网格和组合等基本ExtJS组件,则可以尝试是否

view.query("[store]").map(function(cmp) {return cmp.getStore() });

does what you want... 做你想要的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM