Código:
Ext.onReady(function(){
var mydataGrid=[];
var StoreEgresoVehiculo=Ext.create('Ext.data.Store', {
storeId:'StoreEgresoVehiculo',
autoLoad: true,
fields:[
{name:'Vehiculo' , type: 'string'},
{name:'Patente' , type: 'string'},
],
data:{'items':[]},
buffered:true,
enablePaging:true,
pageSize :1,
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
}) ;
Grid = Ext.create('Ext.grid.Panel', {
id:'sIDGrilla',
title: 'Datos',
titleAlign:'center',
store: StoreEgresoVehiculo,
flex:1,
columns: [
{ text: 'Veh\u00edculo',
dataIndex: 'Vehiculo',
align: 'left',
menuDisabled:true,
width:130,
},
{ text: 'Patente',
dataIndex: 'Patente',
align: 'left',
menuDisabled:true,
width:130,
}
],
height:200,
width: '100%',
scroll:'vertical',
loadMask: true,
renderTo: Ext.getBody(),
bbar:
Ext.create('Ext.PagingToolbar', {
store: StoreEgresoVehiculo,
displayInfo: true,
displayMsg: 'Mostrador Registros {0} - {1} de {2}',
emptyMsg: "No Hay Datos Para Mostrar",
items:[
'-', {
text: 'Cargar Datos.',
handler:
function() {
mydataGrid.push({Vehiculo:'CAR',Patente:'XXX'});
alert('Datos Cagados');
},
},
{
text: 'Paginar.',
handler:
function() {
StoreEgresoVehiculo.loadData(mydataGrid,true);
StoreEgresoVehiculo.loadPage(1);
},
},
{
text:'Pagina2',
handler:
function(){
}
}
]
}),
});
});
Alguien podría decirme porque no se carga las paginas? Que esta mal en el código?
Gracias.