Skip to content

Instantly share code, notes, and snippets.

@darookee
Created May 8, 2012 19:28
Show Gist options
  • Select an option

  • Save darookee/2638688 to your computer and use it in GitHub Desktop.

Select an option

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
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