我App.js的代码在这里:商店加载顺序
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'KP',
appFolder: 'scripts/app',
controllers: [
'MainSearch', 'List'
],
launch: function() {
Ext.create('Ext.container.Viewport', {
items: {
xtype: 'searchdata'
}
});
}
});
的问题是: 我有模式( '列表'),存储( '列表'),视图( '列表')和控制器('列表') - 所有这些都是我的网格。在商店('列表')我打电话给服务,这给了我一些数据。
我想在“MainSearch”表单后查看我的网格。所以,我首先调用了“MainSearch”。 (在App.js中)。但是,在我的浏览器中显示“MainSearch”表单之前,“List”中的服务被调用。我不明白为什么会发生。 (当App.js不包括 '列表' 控制器 - 一切工作正常)
“列表” 的 '商店' 代码:
Ext.define('KP.store.List', {
extend: 'Ext.data.Store',
model: 'KP.model.List',
autoLoad: true,
pageSize: 20,
autoLoad: { start: 0, limit: 20 },
autoSync: true,
proxy: {
type: 'ajax',
limitParam: 'size',
startParam: undefined,
api: {
read: '/adres/listls'
},
reader: {
type: 'json',
root: 'data',
successProperty: 'success',
totalProperty: 'total'
}
}
});
'列表' 控制器代码:
Ext.define('KP.controller.List', {
extend: 'Ext.app.Controller',
views: ['personAccount.List'],
models: ['List'],
stores: ['List'],
init: function() {
this.control({
'list button[action=close]': {
click: this.closeClick
}
});
},
//закрытие формы
closeClick: function (button) {
var win = button.up('window');
win.close();
}
});
我的列表视图代码:
Ext.define('KP.view.personAccount.List', {
extend: 'Ext.window.Window',
alias: 'widget.list',
autoScroll: true,
modal: false,
plain: false,
autoShow: true,
layout: {
type: 'fit'
},
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'gridpanel',
store: 'List',
forceFit: true,
columns: [
....
],
dockedItems: [
{
xtype: 'pagingtoolbar',
store: 'List',
dock: 'bottom',
displayInfo: true
}
]
}
]
});
me.callParent(arguments);
}
});
非常感谢!
这是不是很清楚你问什么,你需要发布更多的信息。 –
它一点也不清楚。 “这是问题”是最好的部分......哪个问题? – sra
可能是由于initComponent:function()在Vew“List”中? – Oleg