Javascript 查找绑定到ExtJS 5.1.x中存储的组件
我有一个gridpanel和一个绑定存储,都配置了对象。存储有“加载”事件 在“load”事件中是否仍然可以获取连接到存储的组件(在这种情况下是gridpanel“fooo”)Javascript 查找绑定到ExtJS 5.1.x中存储的组件,javascript,extjs,extjs5,Javascript,Extjs,Extjs5,我有一个gridpanel和一个绑定存储,都配置了对象。存储有“加载”事件 在“load”事件中是否仍然可以获取连接到存储的组件(在这种情况下是gridpanel“fooo”) 我能想到的唯一方法是在主视图上使用query方法,获取其所有子体并检查哪个组件具有存储“fooo”,也许您应该使用initComponent方法查看动态网格/存储创建 Ext.create("Ext.grid.Panel", { renderTo: Ext.getBody(), viewModel: ne
我能想到的唯一方法是在主视图上使用query方法,获取其所有子体并检查哪个组件具有存储“fooo”,也许您应该使用
initComponent
方法查看动态网格/存储创建
Ext.create("Ext.grid.Panel", {
renderTo: Ext.getBody(),
viewModel: new Ext.app.ViewModel({
name: "globalVM",
stores: {
fooo: {
autoLoad: true,
proxy: {
type: "ajax",
url: "/data.json",
reader: {
type: "json",
rootProperty: "results"
}
},
listeners: {
scope: this,
load: function(ejStore, records, successful, eOpts)
{
var grid;
// obtain connected gridpanel "fooo" component???
grid.getView();
}
}
}
}
}),
items:[{
xtype: "gridpanel",
columns: [{
dataIndex: "title",
text: "Title"
}],
name: "fooo",
bind : {
store: "{fooo}"
}
}]
});