Reputation: 338
I am unable to select multiple rows dynamically for grid having Ext.selection.CheckboxModel.
I have indexes for the rows which I want to select. What is happening is after select call.
for(var i=0;i<count;i++){
Ext.getCmp('loadFrameStateInfoTable').getSelectionModel().select(oldStateSelection[i].index);
}
I got the selection in grid but for only one row. That's the row which index is coming last from oldStateSelection[i].index
.
The grid should have all rows selected.
Upvotes: 3
Views: 6317
Reputation: 1
Here is the new method for ExtJS 6.2.0 and higher:
.getSelectionModel().select(i,true)
- worked for me. Here I record the index.
Method documentation:
select ( records, [keepExisting], [suppressEvent] )
Selects a record instance by record instance or index.PARAMETERS
- records :
Ext.data.Model[]/Number
An array of records or an index- keepExisting :
Boolean (optional)
True to retain existing selections; Defaults to: false- suppressEvent :
Boolean (optional)
True to not fire a select event; Defaults to: false
Upvotes: 0