/* 重写handleMouseDown方法实现不用按住ctrl建多选 */ Ext.override(Ext.grid.CheckboxSelectionModel, { handleMouseDown : function(g, rowIndex, e){ if(e.button !== 0 || this.isLocked()){ return; } var view = this.grid.getView(); if(e.shiftKey && !this.singleSelect && this.last !== false){ var last = this.last; this.selectRange(last, rowIndex, e.ctrlKey); this.last = last; // reset the last view.focusRow(rowIndex); }else{ var isSelected = this.isSelected(rowIndex); if(isSelected){ this.deselectRow(rowIndex); }else if(!isSelected || this.getCount() > 1){ this.selectRow(rowIndex, true); view.focusRow(rowIndex); } } } });
本文出自 “技术之门” 博客,请务必保留此出处http://4247649.blog.51cto.com/4237649/1381032
Ext.grid.GridPanel不需按住Ctrl键单元行多选效果实现,布布扣,bubuko.com
Ext.grid.GridPanel不需按住Ctrl键单元行多选效果实现
原文:http://4247649.blog.51cto.com/4237649/1381032