PDA

View Full Version : paging in grid



shivane
30 Nov 2010, 11:05 PM
hi i am new to extjs i am using grid to display data from my database it contain large data so i need to put paging in it how can i do that pls anyone help me

mankz
1 Dec 2010, 12:20 AM
This example should provide good guidance:

http://dev.sencha.com/deploy/dev/examples/grid/paging.html

shivane
1 Dec 2010, 1:46 AM
Thank you sir i refer this page and do it in my project(I dont know the values that given in root: 'topics',
totalProperty: 'totalCount',
idProperty: 'threadid',
So just i leave these in my project
) but only i got the paging toolbar i didnt get data but i got the no. of rows whereas in the database and this is my code could u find my mistake

code is

/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* [email protected]
* http://www.extjs.com/license
*/
Ext.onReady(function(){
var bd = Ext.getBody();
var cboFilter;
var chkboxOpp=new Ext.grid.CheckboxSelectionModel();
if(cboFilter==null)cboFilter='Active';

//its for get Desktop Height And width
var vWidth=Ext.lib.Dom.getViewWidth();
var vHeight=Ext.lib.Dom.getViewHeight();

function formatDate(value)//For Date Formating eg Apr 17,2008
{return value ? value.dateFormat('d-M-Y'):''; };

// create the Data Store
var LeadListStore = new Ext.data.JsonStore({

remoteSort: true,

fields: [


{ name:'lead_id'},
{name:'lead_firstname'},
{name:'lead_lastename'},
{ name:'lead_company_name'},
{ name:'lead_leadsource'},
{ name:'lead_leadstatus'},
{ name:'lead_created_user'},
{name:'lead_group'},
{name:'lead_assignto'},
{name:'dt_next_contact',type:'date',dateFormat:'Y-m-d'},
{name:'lead_status'}


],

// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: '../crm/get_lead_list.jsp?cboFilter='+cboFilter+'&where='+escape(where)
})
});
LeadListStore.setDefaultSort('lead_firstname', 'asc');
LeadDataModel = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),chkboxOpp,
{header:'lead_id',dataIndex:'lead_id',sortable:true,hidden:true},
{header:'Lead Name',dataIndex:'lead_firstname',sortable:true},
{header:'Comapny Name',dataIndex:'lead_company_name',sortable:true},
{header:'Lead Created By',dataIndex:'lead_created_user',sortable:true},
{header:'Lead Source',dataIndex:'lead_leadsource',sortable:true},
{header:'Lead Status',dataIndex:'lead_leadstatus',sortable:true},
{header:'Assigned To',dataIndex:'lead_assignto',sortable:true},
{header:'Lead Converted',dataIndex:'lead_status',sortable:true},
{header:'Next Contact Date',dataIndex:'dt_next_contact',sortable:true,renderer: formatDate}
]);


// pluggable renders
/* function renderTopic(value, p, record){
return String.format(
'<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
value, record.data.forumtitle, record.id, record.data.forumid);
}
function renderLast(value, p, r){
return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
}*/


var LeadList = new Ext.grid.GridPanel({
id:'LeadList',
bodyStyle:'padding:5px 5px 0',
header:false,
frame:false,
deferredRender:true,
width:(vWidth-200),
height:(vHeight-100),
autoScroll:true,
layout:'fit',
border:false,
title:'Lead List',
cm:LeadDataModel,
store:LeadListStore,
sm:chkboxOpp,
iconCls:'icon-grid',
loadingText:"Loading",
//trackMouseOver:false,
//disableSelection:true,
loadMask: true,
renderTo:'CtlLeadList',
viewConfig: {
forceFit:true,
enableRowBody:true,

},

// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: LeadListStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-']
})
});

// render it
LeadList.render(document.body);


// trigger the data store load
LeadListStore.load({params:{start:0, limit:25}});
} );

mankz
1 Dec 2010, 1:47 AM
Check out this FAQ for paging: http://www.sencha.com/learn/Ext_FAQ_Grid#Paging.2C_Paging_toolbar.2C_Total_record_count

shivane
1 Dec 2010, 2:13 AM
i want to know the values given in the properties
root: 'results',
totalProperty: 'total',
id: 'id'

wat values should i give to these properties

solovieff13
1 Dec 2010, 6:22 AM
totalProperty -- here should be the property from your object, which you will be passed to the reader, that contains all records count.
root -- the root property of the given object, from which you reader will start reading.
For example:
your object has fields:
'count' and 'rows'. First has a value of all records, second contains all useful data the reader will read. So, you should write:
root: rows,
totalProperty: count

shivane
1 Dec 2010, 9:03 PM
thank i gave values to the root and totalproperty but i cant get any data here is my coding could you find the mistake

/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* [email protected]
* http://www.extjs.com/license
*/
Ext.onReady(function(){
var bd = Ext.getBody();
var cboFilter;
var chkboxOpp=new Ext.grid.CheckboxSelectionModel();
if(cboFilter==null)cboFilter='Active';

//its for get Desktop Height And width

var vWidth=Ext.lib.Dom.getViewWidth();
var vHeight=Ext.lib.Dom.getViewHeight();

function formatDate(value)//For Date Formating eg Apr 17,2008
{return value ? value.dateFormat('d-M-Y'):''; };

// create the Data Store
var count=76;//this is total no. of records in my data base
var LeadListStore = new Ext.data.JsonStore({
root: 'lead_id',
totalProperty: 'count',

remoteSort: true,

fields: [


{ name:'lead_id'},
{name:'lead_firstname'},
{name:'lead_lastename'},
{ name:'lead_company_name'},
{ name:'lead_leadsource'},
{ name:'lead_leadstatus'},
{ name:'lead_created_user'},
{name:'lead_group'},
{name:'lead_assignto'},
{name:'dt_next_contact',type:'date',dateFormat:'Y-m-d'},
{name:'lead_status'}


],

// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: '../crm/get_lead_list.jsp?cboFilter='+cboFilter+'&where='+escape(where)
})
});
LeadListStore.setDefaultSort('lead_firstname', 'asc');
/* LeadDataModel = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),chkboxOpp,
{header:'lead_id',dataIndex:'lead_id',sortable:true,hidden:true},
{header:'Lead Name',dataIndex:'lead_firstname',sortable:true},
{header:'Comapny Name',dataIndex:'lead_company_name',sortable:true},
{header:'Lead Created By',dataIndex:'lead_created_user',sortable:true},
{header:'Lead Source',dataIndex:'lead_leadsource',sortable:true},
{header:'Lead Status',dataIndex:'lead_leadstatus',sortable:true},
{header:'Assigned To',dataIndex:'lead_assignto',sortable:true},
{header:'Lead Converted',dataIndex:'lead_status',sortable:true},
{header:'Next Contact Date',dataIndex:'dt_next_contact',sortable:true,renderer: formatDate}
]);*/


// pluggable renders
/* function renderTopic(value, p, record){
return String.format(
'<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
value, record.data.forumtitle, record.id, record.data.forumid);
}
function renderLast(value, p, r){
return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
}*/


var LeadList = new Ext.grid.GridPanel({
// id:'LeadList',
// bodyStyle:'padding:5px 5px 0',
// header:false,
// frame:false,
// deferredRender:true,
width:(vWidth-200),
height:(vHeight-100),
// autoScroll:true,
//layout:'fit',
// border:false,
title:'Lead List',
// cm:LeadDataModel,
store:LeadListStore,
// sm:chkboxOpp,
// iconCls:'icon-grid',
// loadingText:"Loading",
trackMouseOver:false,
disableSelection:true,
loadMask: true,
columns:[
{header:'lead_id',dataIndex:'lead_id',sortable:true,hidden:true},
{header:'Lead Name',dataIndex:'lead_firstname',sortable:true},
{header:'Comapny Name',dataIndex:'lead_company_name',sortable:true},
{header:'Lead Created By',dataIndex:'lead_created_user',sortable:true},
{header:'Lead Source',dataIndex:'lead_leadsource',sortable:true},
{header:'Lead Status',dataIndex:'lead_leadstatus',sortable:true},
{header:'Assigned To',dataIndex:'lead_assignto',sortable:true},
{header:'Lead Converted',dataIndex:'lead_status',sortable:true},
{header:'Next Contact Date',dataIndex:'dt_next_contact',sortable:true,renderer: formatDate}
],
renderTo:'CtlLeadList',
viewConfig: {
forceFit:true,
enableRowBody:true,

},

// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: LeadListStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-']
})
});

// render it
LeadList.render(document.body);


// trigger the data store load
LeadListStore.load({params:{start:0, limit:25}});
} );

shivane
2 Dec 2010, 10:56 PM
now i got data in grid but i did'nt get the paging. the paging toolbar give the result correctly but all data placed in same page pls help me

solovieff13
2 Dec 2010, 11:16 PM
Does your "url: '../crm/get_lead_list.jsp?cboFilter='+cboFilter+'&where='+escape(where)" return different data for each page? Also, please use
to show your code.

shivane
2 Dec 2010, 11:25 PM
returning correct values. now i got correct data in my grid. but paging is not working. all data displayed in first page itself. i have 30 data totally.i set page size as 25. these 30 be displayed in first page. if i click second page the same 30 data be displayed this is my current coding

coding:

/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* [email protected]
* http://www.extjs.com/license
*/
Ext.onReady(function(){
var bd = Ext.getBody();
var cboFilter;
var chkboxOpp=new Ext.grid.CheckboxSelectionModel();
if(cboFilter==null)cboFilter='Active';

//its for get Desktop Height And width
//var count='76';
var vWidth=Ext.lib.Dom.getViewWidth();
var vHeight=Ext.lib.Dom.getViewHeight();

function formatDate(value)//For Date Formating eg Apr 17,2008
{return value ? value.dateFormat('d-M-Y'):''; };

// create the Data Store

var LeadListStore = new Ext.data.JsonStore({
/*root: function(r){
var b = [], p;
for(p in r){
if(r.hasOwnProperty(p)){
b.push({index: p, name: r[p]});
}
}
return b;
},*/
root:'total',
totalProperty:'count',
idProperty:'lead_id',
remoteSort: true,

fields: [


{ name:'lead_id'},
{name:'lead_firstname'},
{name:'lead_lastename'},
{ name:'lead_company_name'},
{ name:'lead_leadsource'},
{ name:'lead_leadstatus'},
{ name:'lead_created_user'},
{name:'lead_group'},
{name:'lead_assignto'},
{name:'dt_next_contact',type:'date',dateFormat:'Y-m-d'},
{name:'lead_status'}


],

// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: '../crm/get_lead_list1.jsp',
method:'GET'
})
/*,baseParams: {
//recordID: Ext.getCmp('combo-ssn').getValue(),
start: 0,
limit: 25
}*/

});
LeadListStore.setDefaultSort('lead_firstname', 'asc');
/*LeadDataModel = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),chkboxOpp,
{header:'lead_id',dataIndex:'lead_id',sortable:true,hidden:true},
{header:'Lead Name',dataIndex:'lead_firstname',sortable:true},
{header:'Comapny Name',dataIndex:'lead_company_name',sortable:true},
{header:'Lead Created By',dataIndex:'lead_created_user',sortable:true},
{header:'Lead Source',dataIndex:'lead_leadsource',sortable:true},
{header:'Lead Status',dataIndex:'lead_leadstatus',sortable:true},
{header:'Assigned To',dataIndex:'lead_assignto',sortable:true},
{header:'Lead Converted',dataIndex:'lead_status',sortable:true},
{header:'Next Contact Date',dataIndex:'dt_next_contact',sortable:true,renderer: formatDate}
]);*/


// pluggable renders
/* function renderTopic(value, p, record){
return String.format(
'<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
value, record.data.forumtitle, record.id, record.data.forumid);
}
function renderLast(value, p, r){
return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
}*/


var LeadList = new Ext.grid.GridPanel({
id:'LeadList',
// bodyStyle:'padding:5px 5px 0',
// header:false,
// frame:false,
// deferredRender:true,
width:(vWidth-200),
height:(vHeight-100),
// autoScroll:true,
// layout:'fit',
//border:false,
title:'Lead List',
// cm:LeadDataModel,
store:LeadListStore,
//sm:chkboxOpp,
//iconCls:'icon-grid',
//loadingText:"Loading",
trackMouseOver:false,
disableSelection:true,
loadMask: true,
columns:[
{header:'lead_id',dataIndex:'lead_id',id:'aa',
sortable:true,hidden:true},
{header:'Lead Name',dataIndex:'lead_firstname',id:'bb',sortable:true},
{header:'Comapny Name',dataIndex:'lead_company_name',id:'dd',sortable:true},
{header:'Lead Created By',dataIndex:'lead_created_user',id:'cc',sortable:true},
{header:'Lead Source',dataIndex:'lead_leadsource',id:'ee',sortable:true},
{header:'Lead Status',dataIndex:'lead_leadstatus',id:'ff',sortable:true},
{header:'Assigned To',dataIndex:'lead_assignto',id:'gg',sortable:true},
{header:'Lead Converted',dataIndex:'lead_status',id:'hh',sortable:true},
{header:'Next Contact Date',dataIndex:'dt_next_contact',id:'ii',sortable:true,renderer: formatDate}
],
renderTo:'CtlLeadList',
viewConfig: {
forceFit:true,
enableRowBody:true,

},

// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: LeadListStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-']
})
});

// render it
LeadList.render(document.body);


// trigger the data store load
LeadListStore.load({params:{start:0, limit:25}});
} );

Condor
3 Dec 2010, 1:16 AM
And how are we supposed to read that?

Please post code using [CODE] tags. Running it through jsbeatifier.org first is also appreciated.

Ext.onReady(function () {
var vWidth = Ext.lib.Dom.getViewWidth(),
vHeight = Ext.lib.Dom.getViewHeight(),
formatDate = function (value) {
return value ? value.dateFormat('d-M-Y') : '';
},
LeadListStore = new Ext.data.JsonStore({
root: 'total',
totalProperty: 'count',
idProperty: 'lead_id',
remoteSort: true,
fields: [{
name: 'lead_id'
},
{
name: 'lead_firstname'
},
{
name: 'lead_lastename'
},
{
name: 'lead_company_name'
},
{
name: 'lead_leadsource'
},
{
name: 'lead_leadstatus'
},
{
name: 'lead_created_user'
},
{
name: 'lead_group'
},
{
name: 'lead_assignto'
},
{
name: 'dt_next_contact',
type: 'date',
dateFormat: 'Y-m-d'
},
{
name: 'lead_status'
}],
proxy: new Ext.data.HttpProxy({
url: '../crm/get_lead_list1.jsp',
method: 'GET'
}),
sortInfo: {
field: 'lead_firstname',
direction: 'ASC'
},
autoLoad: {
params: {
start: 0,
limit: 25
}
}
}),
LeadList = new Ext.grid.GridPanel({
id: 'LeadList',
width: (vWidth - 200),
height: (vHeight - 100),
title: 'Lead List',
store: LeadListStore,
trackMouseOver: false,
disableSelection: true,
loadMask: true,
columns: [{
header: 'lead_id',
dataIndex: 'lead_id',
id: 'aa',
sortable: true,
hidden: true
},
{
header: 'Lead Name',
dataIndex: 'lead_firstname',
id: 'bb',
sortable: true
},
{
header: 'Comapny Name',
dataIndex: 'lead_company_name',
id: 'dd',
sortable: true
},
{
header: 'Lead Created By',
dataIndex: 'lead_created_user',
id: 'cc',
sortable: true
},
{
header: 'Lead Source',
dataIndex: 'lead_leadsource',
id: 'ee',
sortable: true
},
{
header: 'Lead Status',
dataIndex: 'lead_leadstatus',
id: 'ff',
sortable: true
},
{
header: 'Assigned To',
dataIndex: 'lead_assignto',
id: 'gg',
sortable: true
},
{
header: 'Lead Converted',
dataIndex: 'lead_status',
id: 'hh',
sortable: true
},
{
header: 'Next Contact Date',
dataIndex: 'dt_next_contact',
id: 'ii',
sortable: true,
renderer: formatDate
}],
renderTo: 'CtlLeadList',
viewConfig: {
forceFit: true,
enableRowBody: true
},
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: LeadListStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items: ['-']
})
});
});

Condor
3 Dec 2010, 1:18 AM
You are using remote paging. This means your server is supposed to return the correct records based on the 'start', 'limit', 'sort' and 'dir' parameters from the request.

shivane
3 Dec 2010, 1:26 AM
server returns start,limit,sort and dir values correctly no problem in it. i read data from the following jsp.

coding of get_lead_list1.jsp:





{"count":"30","total":[{"lead_id":"1","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"}
,{"lead_id":"2","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"3","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"4","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"5","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"6","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"7","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"8","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"9","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"10","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"11","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"12","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"13","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"14","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"15","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"16","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"17","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"18","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"19","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"20","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"21","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"22","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"23","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"24","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"25","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"26","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"27","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"28","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"29","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"},
{"lead_id":"30","lead_firstname":"Anil","lead_lastename":"Mishra","lead_company_name":"Integrid","lead_leadsource":"Trade Show","lead_leadstatus":"Contacted","lead_created_user":"khalid","lead_group":"Zenith","lead_assignto":" ","dt_next_contact":"OAC 2009","lead_status":"YES"}
]}

Condor
3 Dec 2010, 1:54 AM
The request is send with:

start=0&limit=25&sort=lead_firstname&dir=ASC
but your server is returning 30 record! So it is NOT correctly using the 'start', 'limit', 'sort' and 'dir' parameters.

ps. Or are you looking for local paging? In that case I recommend the PagingStore user extension.

shivane
3 Dec 2010, 2:02 AM
i want remote paging only. i cant get your words correctly. 30 records are the total data in the table. server should return all data.thats only happened. can u explain in detail

Condor
3 Dec 2010, 2:15 AM
Remote paging: For every page the browser does a request with start and limit parameters. The server is supposed to return ONLY <limit> records starting with row no. <start>.

Local paging: There is only one request to the server for all records, but the store displays them in pages.

msinn
8 Dec 2010, 6:45 AM
i want remote paging only. i cant get your words correctly. 30 records are the total data in the table. server should return all data.thats only happened. can u explain in detail

1. you should return just the count of all records for your totalProperty
2. you should return exactly the rows as Condor mentioned above

e.g. for Oracle DB, for other DB should be easier:




$start_row$_POST['start']
$end_row = $start_row + $_POST['limit']

$sql = "
SELECT id,
name,
city,
state
FROM (
SELECT /*+ FIRST_ROWS(100) */
a.*, ROWNUM rnum
FROM (SELECT id,
name,
city,
state
FROM your_db_table
ORDER BY name) a
WHERE ROWNUM <= :end_row
)
WHERE rnum >= :start_row
";

shivane
8 Dec 2010, 11:08 PM
thank you i got the result now its working