PDA

View Full Version : EXTJS Store initialization



vcheruk
20 Jun 2013, 7:41 PM
I have two stores defined in my controller

stores :['TimeZone','ProgramSummary'],

After the viewport and the panel are loaded the grid does not get loaded.

My grid store is setup as below
store: Ext.StoreManager.lookup('id_prgsumstore')

If I explicity create the store the data is loaded- my expectation is that the controller will initialize the stores.

skirtle
20 Jun 2013, 10:20 PM
My first guess would be that the problem is with the storeId. Using the stores config on a controller will override any storeIds you try to set yourself.

See the comment by badgerb1 here:

http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.app.Controller-cfg-stores

mkm_2013
10 Sep 2013, 6:59 AM
Hi I am facing the following problem.
I have data store and teh xml returned has correct value but after loading , teh store doesn't have any value it says record is undefined

var frmRecord = Ext.data.Record.create([
{
name:'frmName',
type:'string'
}
]);





frmNameStore = new Ext.data.Store({
proxy:new Ext.data.HttpProxy({
url:'/stdy/forms/getFormName.do'
}),
reader:new Ext.data.XmlReader({
// totalProperty:'totalrecords',
record:'frmNames',
idProperty:'subj-data'


},
frmRecord),
remoteSort:true,
// autoLoad:true,
pruneModifiedRecords: true,
baseParams:{
ufid1:ufid,
subFormName1:subFormName,
revision1:revision
}
});









frmNameStore.load({
scope:this,
params:{
ufid1:ufid,
subFormName1:subFormName,
revision1:revision
} ,
callback :function(record,operation,success){

alert(frmNameStore.getAt(0));
alert(frmNameStore.getAt(1));
alert(record.get('frmName'));
}
});

the returned url has correct value.
Can anybody please tell me what's wrong? I am stuck on this. Pleeease help

ettavolt
10 Sep 2013, 9:03 PM
Load callback receives records, not a record.

mkm_2013
11 Sep 2013, 6:19 AM
Thanks for reply . The frmNameStore.getAt(0) is blank. It should have return soem value