Forked from yuristrelets/gist:d88abca500199cff1b50
Created
September 5, 2017 06:29
-
-
Save dcyou/6c1ee3d704e50e1f424aa308bdf583c3 to your computer and use it in GitHub Desktop.
Get selected record in ExtJS 4.2.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getSelectedRecord: function() { | |
var grid = this.getGrid(), | |
records = grid.getSelectionModel().getSelection(), | |
record; | |
if(records.length) { | |
// get first record from selection | |
record = records[0]; | |
// find selection record in store | |
record = grid.getStore().getById(record.getId()); | |
if(record) return record; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment