PDA

View Full Version : store can load the data



dave0224
2 May 2007, 8:55 PM
hello

this is myCombo.js


Ext.data.CountryStore = function(config){
Ext.data.CountryStore.superclass.constructor.call(this, {
reader: new Ext.data.JsonReader(
{
root: 'result',
totalProperty: 'totalCount',
id: 'ID'
},
[
{name: 'ID', mapping: 'ID'},
{name: 'COUNTRY_CODE', mapping: 'COUNTRY_CODE'},
{name: 'COUNTRY_NAME_E', mapping: 'NAME_E'},
{name: 'COUNTRY_NAME_C', mapping: 'NAME_C'}
]
),
proxy : new Ext.data.ScriptTagProxy({url: 'geographicalCombo.action?method=getCountries'})
});
//this.load();
};
Ext.extend(Ext.data.CountryStore , Ext.data.Store);


and i inculde my js and uset the obj


var country_store = new Ext.data.CountryStore({});

country_store.load();

and the store data is empty,but i put all in a file ,it is work

can anyone can tell me how to change my code.

sfwalter
3 May 2007, 4:05 AM
Just curious, why are you subclassing Ext.data.Store? It doesn't seem like you are adding any value to CountryStore. You could have simply created an instance of Ext.data.Store and passed in the proxy and reader.

scott.