PDA

View Full Version : How to create function in store and call it?



korndeang
12 May 2013, 7:05 PM
Hi all,

I have follow MVC, Could i creat function in store? example i create function foo()
When i load store could i call it? how?

evant
12 May 2013, 7:07 PM
Ext.define('MyStore', {
extend: 'Ext.data.Store',

foo: function(){
console.log('Foo');
}
});

Ext.onReady(function(){
var s = new MyStore({
fields: ['a']
});
s.foo();
});

korndeang
12 May 2013, 7:17 PM
Many thanks, work fine!