日期:2014-05-16 浏览次数:20327 次
{ xtype: 'multiselect', name: 'multiselect', store: Store, width: 200, AutoHeight: true, allowBlank:false, valueField:"value", displayField:"text", listeners:{ select:function(multiselect, record,index){ var selectionsArray = this.multiselect.view.getSelectedIndexes(); var records = []; if (selectionsArray.length > 0) { for (var i=0; i<selectionsArray.length; i++) { record = this.multiselect.view.store.getAt(selectionsArray[i]); records.push(record); } } Ext.MessageBox.alert("恭喜",records); } }
多选框这样来配置,如果要重写或添加方法可以看看扩展api { xtype: "itemselector", name: "", fieldLabel: "查看", msWidth: 170, msHeight: 150, valueField: "id", displayField: "text", imagePath: "JavaScript/MultiSelect/", fromLegend: "可选", toLegend: "已选", fromStore: StoresFrom, toStore: StoresTo },