PDA

View Full Version : About Store of TouchStyle Example



kim2ee
18 Mar 2012, 10:22 PM
I am readding the source code of TouchStyle, and I find
in the controller, store named Categories will be loaded in init function.
Like this :
init: function() {
Ext.getStore('Categories').on('load', this.onStoreLoad, this);
},

But I am confused that I can not find onStoreLoad function, where it is?

mitchellsimoens
19 Mar 2012, 9:05 AM
It's no where. That line needs to be removed.

jonathanh
21 Mar 2012, 12:51 AM
May I know where is the source code for the ST2 Touchstyle example? When i view source it shows the minified version only.

mitchellsimoens
21 Mar 2012, 4:19 AM
May I know where is the source code for the ST2 Touchstyle example? When i view source it shows the minified version only.

When you download Senha Touch 2, unzip it and look in the examples folder for the touchstyle example.

jonathanh
21 Mar 2012, 7:24 PM
When you download Senha Touch 2, unzip it and look in the examples folder for the touchstyle example.

Ahh thank you! Was searching high and low through the online documentation and it didn't occur to me to look inside my own folders :)

ci11111
23 Mar 2012, 7:27 AM
why not doing like this rather that always calling ensureStoreLoad



init: function() {
/*Ext.getStore('Categories').on('load', this.onStoreLoad, this);*/
this.store = Ext.getStore('Categories');
this.store.on('load', function() {
console.log('store loaded');
this.showRootCategory();
}, this, {
single: true
});
},
/*ensureStoreLoad: function(action) {
var store = Ext.getStore('Categories');


if (store.data.all.length) {
action.resume();
} else {
store.on('load', function() {
action.resume();
}, this, {
single: true
});
}
},*/