PDA

View Full Version : How to avoiad stores autoload TRUE when page system boot?



korndeang
9 May 2013, 1:22 AM
Hi all,
I am using Extj4+ MVC, I have one controller name "Accounts" this controller manage manay view pages and forms, and form has defferent kind of itemse.g, xtype combobox (list data from database) and all form item are load from dabase too,
Ext.define('Myapp.controller.Accounts', {
extend: 'Ext.app.Controller',
requires: ['Myapp.Utilities'],
views: [
'account.Add',
'account.Edit',
'account.List'
],
stores: [ //Here many stores will be use
'Account','AccountList','User','Country',
'City','District','Commune',
'ShippingCity','ShippingDistrict',
'ShippingCountry', 'ShippingCommune',
'IspList','ServicePlan','AccountType',
'AssignTo','Industry'
],
models: ['Account'],
refs: [
{
ref : 'accAdd',
xtype:'accountAdd',
selector: 'account-form-add',
autoCreate :true
},{
ref : 'accEdit',
xtype:'accountEdit',
selector: 'account-form-edit',
autoCreate :true
},{
ref : 'accList',
xtype:'accountList',
selector: 'account-form-list',
autoCreate :true
}
],

init: function(application) {
if(this.inited){
return;
}
this.inited = true;

Myapp.Utilities.logShow =true; //Set to TRUE for development
this.application.on({
scope:this
});
}
});
Not:

Accounts controller auto execute when app.js is booting up, so all my stores are load automatic make my application slow performance.
I know because all my store files config autoLoad: true if set to false my app error because can't find store. How can i load store when i want without load when system boot?

Stormseeker
9 May 2013, 8:04 AM
Accounts controller auto execute when app.js is booting up, so all my stores are load automatic make my application slow performance.
I know because all my store files config autoLoad: true if set to false my app error because can't find store. How can i load store when i want without load when system boot?


Setting autoLoad to false shouldn't throw an error. Which error are you getting? Perhaps remove the autoLoad configuration completely since the default is undefined (I.E. false).

existdissolve
9 May 2013, 4:50 PM
Hi all,
I am using Extj4+ MVC, I have one controller name "Accounts" this controller manage manay view pages and forms, and form has defferent kind of itemse.g, xtype combobox (list data from database) and all form item are load from dabase too,
Ext.define('Myapp.controller.Accounts', {
extend: 'Ext.app.Controller',
requires: ['Myapp.Utilities'],
views: [
'account.Add',
'account.Edit',
'account.List'
],
stores: [ //Here many stores will be use
'Account','AccountList','User','Country',
'City','District','Commune',
'ShippingCity','ShippingDistrict',
'ShippingCountry', 'ShippingCommune',
'IspList','ServicePlan','AccountType',
'AssignTo','Industry'
],
models: ['Account'],
refs: [
{
ref : 'accAdd',
xtype:'accountAdd',
selector: 'account-form-add',
autoCreate :true
},{
ref : 'accEdit',
xtype:'accountEdit',
selector: 'account-form-edit',
autoCreate :true
},{
ref : 'accList',
xtype:'accountList',
selector: 'account-form-list',
autoCreate :true
}
],

init: function(application) {
if(this.inited){
return;
}
this.inited = true;

Myapp.Utilities.logShow =true; //Set to TRUE for development
this.application.on({
scope:this
});
}
});
Not:

Accounts controller auto execute when app.js is booting up, so all my stores are load automatic make my application slow performance.
I know because all my store files config autoLoad: true if set to false my app error because can't find store. How can i load store when i want without load when system boot?


Do you have code that is expecting the store to exist with data on load? If so, you should rework your code to only leverage the store(s) when you have explicitly loaded them, or on one of the events of the store itself (e.g., load, etc.)

korndeang
9 May 2013, 7:51 PM
I got it work, if autoload =false , when i want call i should
Ext.getCmp('AccountStore').load()
need add load() :-?

Thanks your help!