PDA

View Full Version : problem with paging in grid



kirankumar1231
22 Mar 2011, 11:27 PM
problem with paging in grid
paging toolbar is not added to grid
this is my code



<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
var reader=new Ext.data.JsonReader({
},[
{name: 'empid',mapping:'empid'},
{name: 'empname'}
]
);
var store=new Ext.data.Store({
root:'employee',
proxy : new Ext.data.HttpProxy({
url: 'get.json',
method:'GET'
}),
reader:reader
});
var colModel = new Ext.grid.ColumnModel([
{header: "empid", width: 120, sortable: true, dataIndex: "empid"},
{header: "empname", width: 90, sortable: true, dataIndex: "empname"}
]);
var grid = new Ext.grid.GridPanel({ height:200,
width:200,
store:store,
cm: colModel,
bbr:new Ext.PagingToolbar({
pageSize:10,
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
})
});
store.load({params:{start:0, limit:10}});
grid.render(document.body);
});

hpet
23 Mar 2011, 12:16 AM
If you try "bbar" instead of "bbr" ?

kirankumar1231
23 Mar 2011, 12:35 AM
modified the code like the one below
still its not working



<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
var reader=new Ext.data.JsonReader({
},[
{name: 'empid',mapping:'empid'},
{name: 'empname'}
]
);
var store=new Ext.data.Store({
root:'employee',
proxy : new Ext.data.HttpProxy({
url: 'get.json',
method:'GET'
}),
reader:reader
});
var colModel = new Ext.grid.ColumnModel([
{header: "empid", width: 120, sortable: true, dataIndex: "empid"},
{header: "empname", width: 90, sortable: true, dataIndex: "empname"}
]);
var paging=new Ext.PagingToolbar({
pageSize:5,
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
});
var grid = new Ext.grid.GridPanel({ height:200,
width:200,
store:store,
cm: colModel,
bbbr:paging
});
store.load({params:{start:0, limit:5}});
grid.render(document.body);
});
</script>

hpet
23 Mar 2011, 12:39 AM
Is this a joke?

Before you had: bbr:new Ext.PagingToolbar({...}]

Now you have: bbbr

It is bbar.

kirankumar1231
23 Mar 2011, 12:45 AM
sorry i dint observe much
i am new to this extjs
now itz working partially
i can get it solved
thanks for u r help