I am encountering a strange behaviour regarding my grid selection:
I have a simple grid, but when I select a record, I do:
var grid = this.getExternrulesgrid();
var records = grid.getSelectionModel().getSelection();
var rec = this.getSelectedExternRule();
But for some reason, records
is empty?!
Do you have any idea as to why?
Thank you!!
Their are various ways you can get the selected record.
1.You can use selectionchange event listener.
selectionchange( this, selected, eOpts ){
}
Here, selected : The selected records.
2.Using selection model on some action
selected=[];
selctn = grid.getSelectionModel();
var s = selctn.getSelection();
Ext.each(s, function(item) {
selected.push(item);
});
You will be getting the array of selected records in selected array.
Note: Check your grid object.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.