PDA

View Full Version : Problems with the paging toolbar



rmorales
6 Jan 2012, 8:42 AM
Hello friends.

I dont know what happen with my paging toolbar, I have my store.

Ext.define("Extidi.modulos.testpersonas.store.PersonasStore", {

extend : 'Ext.data.Store',



proxy : {
type : 'ajax',
model : "Extidi.modulos.testpersonas.model.PersonasModelo",
url : Extidi.Constantes.URL_TESTPERSONAS_CONTROLLER,
actionMethods : {
read : 'POST'
},
reader : {
type : 'json',
root : 'data',
totalProperty : "total"
}
}


});

And my php function


function respuesta($success,$data,$variable,$listar=false,$start=0,$limit=0){ //if($limit==25)$limit=2;

if($variable=="data"){
if($listar){
$auxiliar["total"]=count($data);
$auxiliar[$variable]=$respuesta=array_splice($data,$start,$limit);
}else{
$auxiliar[$variable]=$data;
}
}else{
$auxiliar[$variable]=$data;
}
$auxiliar["success"] = $success;
echo json_encode($auxiliar);

}

And my grid and pagingToolbar


var toolbarPaginador = new Ext.PagingToolbar({
store: this.storeGrillaPrincipal,
displayInfo: true,
displayMsg: '{0} - {1} de {2} '+ this.tituloGrillaPrincipal,
emptyMsg: 'No hay '+this.tituloGrillaPrincipal+' para mostrar.',
pageSize:2

});
var grillaPrincipal = Ext.create('Ext.grid.GridPanel', {
id : 'grillaPrincipal',
title : formulario.tituloGrillaPrincipal,
store : formulario.storeGrillaPrincipal,
region : 'center',
bbar:toolbarPaginador,
columns : formulario.columnasGrillaPrincipal,
listeners : {
itemclick : function(s, record) {
formulario.fireEvent('clickElementoGrilla', record,
formulario,
formulario.getFormularioEdicion(),
formulario.getToolbarGrillaPrincipal(),
formulario.getToolbarFormulario())
},
itemdblclick : function(s, record) {
formulario.fireEvent('dobleClickElementoGrilla',
record, formulario,
formulario.getFormularioEdicion(),
formulario.getToolbarGrillaPrincipal(),
formulario.getToolbarFormulario())
}
}
});

But the pages in the paging toolbar don't appear, what happen????

30513

mitchellsimoens
6 Jan 2012, 1:16 PM
The paging toolbar has the same store as your grid? The response is right?

rmorales
6 Jan 2012, 1:27 PM
Right