We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

arunpjohny on 08/25/08


Tagged

extjs


Versions (?)


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.