PDA

View Full Version : How to get the start and limit associated with store



pk.hafeez
25 Dec 2012, 1:03 AM
Hi Merry Christmas,

I have a grid panel. In it i'm showing one of the columns which holds the row numbers. I have used the rownumberer. But when i navigate to the next page again my numbers start from one. I'm doing like this on my column now. Not to able to get hold of the start.


{ text : 'row',
dataIndex: 'rowIndex',
sortable : false,
// other config you need..
renderer : function(value, metaData, record, rowIndex, colIndex, store) {
//how to get start
return store.start + rowIndex;
}
}

I know the params start and limit will be associated with store proxy. will start and limit become extra params. some how i need the start in this case. please advice

skirtle
25 Dec 2012, 6:36 AM
currentPage should allow you to calculate the row index:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-property-currentPage

pk.hafeez
26 Dec 2012, 5:40 AM
Thanks a lot. Got it working :)

renderer : function(value, metaData, record, rowIndex, colIndex, store)
{
return (((store.currentPage-1)*_itemsPerPage)+rowIndex+1);
}