im trying to use paging with data in client side (memoryproxy), but it doenst work.
all data are aways shown in grid and nothing happens when i try to change the page.
whats wrong??
Code:
Ext.onReady(function() {
Ext.QuickTips.init();
store = new Ext.data.Store({
totalProperty: 2,
fields: [
{name: 'nome' },
{name: 'sexo' },
{name: 'nascimento', type: 'date', dateFormat: 'Y-m-d h:i:s' },
],
data: json_data,
proxy:
{
type:'memory',
reader:{
type:'json'
}
}
});
// create the Grid
grid = new Ext.grid.GridPanel({
store: store,
columnLines: true,
totalProperty:2,
columns: [
{
text : 'Nome',
flex : 4,
width : 200,
sortable : true,
dataIndex: 'nome'
},
{
text : 'Sexo',
flex : 1,
width : 10,
sortable : true,
dataIndex: 'sexo'
},
{
text : 'Nascimento',
width : 135,
flex : 1,
sortable : true,
renderer : Ext.util.Format.dateRenderer('d/m/Y'), // formato de exibição
dataIndex: 'nascimento'
}
],
bbar: new Ext.PagingToolbar({
store:store,
pageSize:2
}),
height: 350,
width: '100%',
renderTo: 'grid'
});
grid.render();
store.load({params: {start:0,limit:2}});
});