Posted By

arunpjohny on 08/25/08


Tagged

extjs


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Anber


Extjs CheckboxSelectionModel keepExisting


 / Published in: JavaScript
 

  1. Ext.CheckboxSelectionModel.override({
  2. handleMouseDown : function(g, rowIndex, e){
  3. if(e.button !== 0 || this.isLocked()){
  4. return;
  5. };
  6. var view = this.grid.getView();
  7. if(e.shiftKey && this.last !== false){
  8. var last = this.last;
  9. this.selectRange(last, rowIndex, e.ctrlKey);
  10. this.last = last; // reset the last
  11. view.focusRow(rowIndex);
  12. }else{
  13. var isSelected = this.isSelected(rowIndex);
  14. if(e.ctrlKey && isSelected){
  15. this.deselectRow(rowIndex);
  16. }else if(!isSelected || this.getCount() > 1){
  17. this.selectRow(rowIndex, true);
  18. view.focusRow(rowIndex);
  19. }
  20. }
  21. }
  22. });

Report this snippet  

You need to login to post a comment.