PDA

View Full Version : [SOLVED] How to re-number Grid's row numbering on deletion, using RowNumberer



abhilashca
29 Jun 2011, 11:39 PM
Hello,

I have an Editable Grid with column-types: RowNumberer, CheckColumn (CheckBoxSelectionModel) and other normal data columns. In my grid, I have a delete button, which deletes the selected (via Checkbox) records.

For deletion, I'm deleting the record from the Store object. The code looks like:


grid.getStore().remove(selected[i])

The issue is: whenever I deletes a record, the row numbering is not re-numbered automatically. That means, suppose I have 5 records, which on loading has row numbers as 1,2,3,4,5 respectively. If I delete 2nd and 4th record, then the row numbering will be : 1,3,5; instead of 1,2,3.

How can I re-number automatically? Is that can be done programatically or will be handled automatically?

Any help will be appreciated.
Thanks.

arthurakay
30 Jun 2011, 1:52 PM
I'm pretty sure you need to refresh the GridView
- http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.grid.GridView

The refresh() method should do the trick.

abhilashca
1 Jul 2011, 12:40 AM
That was yummy!


grid.getView.refresh();

I thought that'll will be handled internally. :)
Thanks