Given that I've got a ExtJS grid using a CheckBoxModel, what is the best way to get a list of all the records where the checkbox is checked?
In ExtJS 4, to select records in a grid with selection model as Ext.selection.CheckboxModel do:
var selectedRecords = grid.getSelectionModel().getSelection();
// And then you can iterate over the selected items, e.g.:
selected = [];
Ext.each(selectedRecords, function (item) {
selected.push(item.data.someField);
});
I hope this helps
simply by using getSelection()
like this :
var selectedRecordsArray = grid.getView().getSelectionModel().getSelection();
var arrayList=[],
selected=Ext.getCmp('wpDetaPrdsDetailGrid').getView().getSelectionModel().getSelection();
Ext.each(selected, function (item) {
arrayList.push(item.data);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With