PDA

View Full Version : RowNumberer issue wtih using paging



talha06
21 May 2012, 11:40 PM
Hello everyone,

RowNumberer always starts with 1 while using paging. I was using PagingRowNumberer extension for ExtJS 2.x & 3.x. I've looked the documentation but I haven't seen any property for this. I want to learn if I didn't become aware of a config for this or what I need to do.

Thanks in advance,
With regards.

sword-it
22 May 2012, 12:01 AM
Hi,
For Ext4.X, you may use {xtype: 'rownumberer'}

sample is:-



FOR Ext 4.X

columns: [
{xtype: 'rownumberer'},
{text: "Company", flex: 1, sortable: true, dataIndex: 'company'},
{text: "Price", width: 120, sortable: true}
]


For ext 3.X, you may use Ext.grid.RowNumberer (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.RowNumberer)()....




For Ext 3.X


var colModel = new Ext.grid.ColumnModel (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.ColumnModel)([
new Ext.grid.RowNumberer (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.RowNumberer)(),
{header: "Name", width: 80, sortable: true},
{header: "Code", width: 50, sortable: true}
]);

talha06
22 May 2012, 12:03 AM
Hi,
For Ext4.X, you may use {xtype: 'rownumberer'}

sample is:-



FOR Ext 4.X

columns: [ {xtype: 'rownumberer'}, {text: "Company", flex: 1, sortable: true, dataIndex: 'company'}, {text: "Price", width: 120, sortable: true} ]

For ext 3.X, you may use Ext.grid.RowNumberer (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.RowNumberer)()....




For Ext 3.X


var colModel = new Ext.grid.ColumnModel (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.ColumnModel)([ new Ext.grid.RowNumberer (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.RowNumberer)(), {header: "Name", width: 80, sortable: true}, {header: "Code", width: 50, sortable: true}, {header: "Description", width: 200, sortable: true} ]);

Yeah I've been using it which is default for grids. I think if the library itself doesn't have a class for this; I should write an extension for this. Anyway thanks for your interest my mate.

paultorben
22 May 2012, 2:10 PM
Isn't the question why RowNumberer always starts with '1'? I have the 'pagingtoolbar' enabled - pages have 50 items - I would like for the second page to start RowNumberer with '51'. Just not sure how to ... any ideas? Thanks in advance ...