0
votes

I have a gridpanel with data, I can show the total number of records in the grid by store.getcount(). When I click a record, I would like to show the number of the selected record.

For example:

  • The total number of records is 5
  • I click the first row
  • A textbox will show 1/5
2

2 Answers

3
votes
grid.getSelectionModel().getCount()
0
votes

Try this in your grid select listener:

listeners:{
            select: function(selModel, record, index, options) {
                your_textfield.setValue(index+'/'+Ext.getCmp('yourGridId').store.getCount());
            }
        }