PDA

View Full Version : autoLoad param name issue



Thomas Triplet
22 Jul 2010, 2:27 PM
I'm having a weird problem with a parameter name for a class that extend a GridPanel. Basically, I'd like to have an autoLoad param, which controls the store's autoLoad param.

However, when I call this param "autoLoad", it's not working, although it works fine with another name like "initLoad". Am I missing something here??


PrimerTable = Ext.extend(Ext.grid.GridPanel, {
//Defaults
title : 'Primers'
,url : 'primers/get_all'
,initLoad : true
,viewConfig : { forceFit : true }
,columns : [
{
header : 'primer_id',
dataIndex : 'primer_id'
},
{
header : 'name_forward',
dataIndex : 'name_forward'
}
],

// May not be overriden
initComponent : function() {
this.store = this.buildStore();
PrimerTable.superclass.initComponent.call(this);
},

buildStore : function() {
return {
xtype : 'jsonstore',
proxy: new Ext.data.HttpProxy({
url: this.url,
method: 'POST'
}),
autoLoad : this.initLoad,
fields : [
'primer_id'
,'name_forward'
],
root: 'data',
totalProperty: 'nTotal',
sortInfo : {
field : 'primer_id',
dir : 'ASC'
}
};
}
});
Ext.reg('primertable', PrimerTable);

Thanks for any input :)

Animal
22 Jul 2010, 2:36 PM
autoLoad will work