itemselector用法,itemselector
var store = new Ext.data.Store({ // autoLoad:true, // 擷取資料的方式 proxy : new Ext.data.HttpProxy({ url : 'connCfgManage.do?reqCode=getChannelCode' }), // 資料讀取器 reader : new Ext.data.JsonReader({ autoLoad : false, totalProperty : 'TOTALCOUNT', // 記錄總數 root : 'ROOT' // Json中的列表資料根節點 }, [{ name : 'channelCode' }]) }); var store2 = new Ext.data.Store({ autoLoad : false, // 擷取資料的方式 proxy : new Ext.data.HttpProxy({ url : 'accountChannel.do?reqCode=getAccountChannelInfo' }), // 資料讀取器 reader : new Ext.data.JsonReader({ autoLoad : true, totalProperty : 'TOTALCOUNT', // 記錄總數 root : 'ROOT' // Json中的列表資料根節點 }, [{ name : 'channelCode' }]) }); var sm = new Ext.grid.CheckboxSelectionModel({ singleSelect : false }); var isForm = new Ext.form.FormPanel({ title : '商戶帳號渠道配置選擇', width : 700, region : 'center', buttonAlign : 'center', bodyStyle : 'padding:10px;',// 定義樣式表 items : [{ xtype : 'itemselector', name : 'itemselector', id : 'myIt', toLegend : "已選欄", fromLegend : "可選欄", drawUpIcon : false, drawDownIcon : false, drawLeftIcon : true, drawRightIcon : true, drawTopIcon : false, drawBotIcon : false, hideLabel : false, imagePath : '../resource/extjs3.1/ux/images/',// 左右移動的圖片 multiselects : [{// 定義左邊資料 legend : '可選渠道', width : 250, height : 300, store : store, displayField : 'channelCode', valueField : 'channelCode' }, { legend : '已有渠道', width : 250, height : 300, displayField : 'channelCode', valueField : 'channelCode', store : store2, tbar : [{ text : '清除所有', iconCls : 'deleteIcon', handler : function() { isForm.getForm().findField('itemselector') .reset(); } }] }] }], buttons : [{ text : '提交列表', iconCls : 'acceptIcon', handler : function() { saveAccountBank(); } }, { text : '關閉', iconCls : 'deleteIcon', handler : function() { cWindow.close(); } }] });store.load({ params : { connType : threeForm.getForm().findField('connType') .getValue() }, callback : function() { editChannelCode(); } }); function editChannelCode() { if ("defaultEdit" == temp || "customizedEdit" == temp) { store2.load({ params : { connType : threeForm.getForm() .findField('connType').getValue(), merId : merId, merAccount : merAccount, temp : temp }, callback : function(records, options, success) { for (i = 0; i < records.length; i++) { var channelCode = records[i].get('channelCode'); var index = store.find("channelCode", channelCode); store.removeAt(index); } } }); } else if ("customized" == temp || "default" == temp) { store2.removeAll(); } }var channelCode = Ext.getCmp("myIt").getValue();擷取右邊的所有值