Extjs - how to select a row in a grid with a right-mouse click


/ Published in: JavaScript
Save to your folder(s)

This refers to Ext JS version 3 !


Copy this code and paste it in your HTML
  1. // add a listener to the grid and add the following lines
  2. this.on('rowcontextmenu', function(grid, row, e) {
  3. grid.selectedNode = grid.store.getAt(row); // we need this
  4. if((row) !== false) {
  5. this.getSelectionModel().selectRow(row);
  6. }
  7. ... and the rest of your code ...
  8.  
  9. }, this);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.