PDA

View Full Version : Please Help !!! I have problems with the Ext.PagingToolbar "store: this.store '



David Martinez
15 Jul 2009, 8:53 AM
Please Help !!! I have problems with the Ext.PagingToolbar "store: this.store '= undefined.

CODE:

var personas = {

title: 'Lista de Personas',
xtype: 'grid',
id: 'personas-panel',
store:new Ext.data.JsonStore({
id:'id',
totalProperty:'total',
root:'rows',
url:'sendTwoPaging2.jsp',
fields:[
{name:'rut'},
{name:'apellidoPaterno', type:'string'},
{name:'apellidoMaterno', type:'string'},
{name:'nombre', type:'string'}
]
}),
columns:[
{header:'Código', width:120, sortable:true, dataIndex:'rut'},
{header:'Ap. Paterno', width:120, sortable:true, dataIndex:'apellidoPaterno'},
{header:'Ap. Materno', width:120, sortable:true, dataIndex:'apellidoMaterno'},
{header:'Nombres', width:120, sortable:true, dataIndex:'nombre'}
],
bbar:new Ext.PagingToolbar({
id:'id',
store:this.store,
pageSize:10,
displayMsg:'Registro: {0} - {1} de {2}',
emptyMsg:'No existen Registros'
}),
viewConfig : {
forceFit: true,
loadMask: true
},
// Add a listener to load the data only after the grid is rendered:
listeners: {
render: function(){
this.store.load({params:{start:0, limit:10}});
}
}
};

tryanDLS
15 Jul 2009, 5:12 PM
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly

What do you think 'this' points to at that point?

mjlecomte
15 Jul 2009, 8:24 PM
As Tim points out you have a scope problem. There are two articles in the wiki about scope you should read about
http://extjs.com/learn/Tutorials#Application_Design