0
当实施SuperBoxSelect(http://www.sencha.com/forum/showthread.php?69307-3.x-Ext.ux.form.SuperBoxSelect)时,我意识到它目前不支持shift +单击多个项目的选择。有没有人能够实现此功能或找到一个类似的插件,提供此功能?SuperBoxSelect:使用Shift +单击一次选择多个项目
当实施SuperBoxSelect(http://www.sencha.com/forum/showthread.php?69307-3.x-Ext.ux.form.SuperBoxSelect)时,我意识到它目前不支持shift +单击多个项目的选择。有没有人能够实现此功能或找到一个类似的插件,提供此功能?SuperBoxSelect:使用Shift +单击一次选择多个项目
beforeadditem:function(self, recordValue) {
var start = 0;
var end = 0;
var record = this.findRecord(this.valueField, recordValue);
var recordIndex = this.store.indexOf(record);
if(window.event.shiftKey) {
this.multiSelectMode = true;
if(this.firstChoiceIndex == undefined) {
this.firstChoiceIndex = recordIndex;
this.view.all.item(recordIndex).addClass('x-combo-selected-shift');
return false;
} else {
this.secondChoiceIndex = recordIndex;
if(this.firstChoiceIndex > this.secondChoiceIndex) {
start = this.secondChoiceIndex;
end = this.firstChoiceIndex;
} else if(this.secondChoiceIndex > this.firstChoiceIndex) {
start = this.firstChoiceIndex;
end = this.secondChoiceIndex;
}
var selectedRecords = this.store.getRange(start, end);
Ext.each(selectedRecords, function(item, index, allitems) {
self.addRecord(item)
});
this.firstChoiceIndex = undefined;
this.secondChoiceIndex = undefined;
return false;
}
} else {
this.firstChoiceIndex = undefined;
this.secondChoiceIndex = undefined;
return true;
}
}
添加该监听器,它的工作原理。 x-combo-selected-shift类与x-combo-selected类相同。它只是被命名为不同,所以突出显示将保留在您移出鼠标后点击的项目上。