Extjs CheckboxSelectionModel keepExisting


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



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.