Created
May 8, 2012 19:28
-
-
Save darookee/2638688 to your computer and use it in GitHub Desktop.
ExtJS 4 - use one function with grid dblclick and buttonclick when one row is selected
This file contains hidden or 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
| init: function() { | |
| this.control({ | |
| 'grid': { | |
| itemdblclick: this.editRow | |
| }, | |
| 'grid button[action=edit]': { | |
| 'click': function( element, event ) { | |
| var grid = element.findParentByType( 'grid' ); | |
| var record = grid.getSelectionModel().getSelection()[0]; | |
| if( typeof record !== 'undefined' ) { | |
| this.editRow( grid, record ); | |
| } | |
| } | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment