1 var store = new Ext.data.Store({
2 // autoLoad:true,
3 // 获取数据的方式
4 proxy : new Ext.data.HttpProxy({
5 url : 'connCfgManage.do?reqCode=getChannelCode'
6 }),
7 // 数据读取器
8 reader : new Ext.data.JsonReader({
9 autoLoad : false,
10 totalProperty : 'TOTALCOUNT', // 记录总数
11 root : 'ROOT' // Json中的列表数据根节点
12 }, [{
13 name : 'channelCode'
14 }])
15 });
16
17 var store2 = new Ext.data.Store({
18 autoLoad : false,
19 // 获取数据的方式
20 proxy : new Ext.data.HttpProxy({
21 url : 'accountChannel.do?reqCode=getAccountChannelInfo'
22 }),
23 // 数据读取器
24 reader : new Ext.data.JsonReader({
25 autoLoad : true,
26 totalProperty : 'TOTALCOUNT', // 记录总数
27 root : 'ROOT' // Json中的列表数据根节点
28 }, [{
29 name : 'channelCode'
30 }])
31 });
32 var sm = new Ext.grid.CheckboxSelectionModel({
33 singleSelect : false
34 });
35
36 var isForm = new Ext.form.FormPanel({
37 title : '商户账号渠道配置选择',
38 width : 700,
39 region : 'center',
40 buttonAlign : 'center',
41 bodyStyle : 'padding:10px;',// 定义样式表
42 items : [{
43 xtype : 'itemselector',
44 name : 'itemselector',
45 id : 'myIt',
46 toLegend : "已选栏",
47 fromLegend : "可选栏",
48 drawUpIcon : false,
49 drawDownIcon : false,
50 drawLeftIcon : true,
51 drawRightIcon : true,
52 drawTopIcon : false,
53 drawBotIcon : false,
54 hideLabel : false,
55 imagePath : '../resource/extjs3.1/ux/images/',// 左右移动的图片
56 multiselects : [{// 定义左边数据
57 legend : '可选渠道',
58 width : 250,
59 height : 300,
60 store : store,
61 displayField : 'channelCode',
62 valueField : 'channelCode'
63 }, {
64 legend : '已有渠道',
65 width : 250,
66 height : 300,
67 displayField : 'channelCode',
68 valueField : 'channelCode',
69 store : store2,
70 tbar : [{
71 text : '清除所有',
72 iconCls : 'deleteIcon',
73 handler : function() {
74 isForm.getForm().findField('itemselector')
75 .reset();
76 }
77 }]
78 }]
79 }],
80 buttons : [{
81 text : '提交列表',
82 iconCls : 'acceptIcon',
83 handler : function() {
84 saveAccountBank();
85 }
86 }, {
87 text : '关闭',
88 iconCls : 'deleteIcon',
89 handler : function() {
90 cWindow.close();
91 }
92 }]
93 });
94
95
96 store.load({
97 params : {
98 connType : threeForm.getForm().findField('connType')
99 .getValue()
100 },
101 callback : function() {
102 editChannelCode();
103 }
104 });
105
106 function editChannelCode() {
107 if ("defaultEdit" == temp || "customizedEdit" == temp) {
108 store2.load({
109 params : {
110 connType : threeForm.getForm()
111 .findField('connType').getValue(),
112 merId : merId,
113 merAccount : merAccount,
114 temp : temp
115 },
116 callback : function(records, options, success) {
117 for (i = 0; i < records.length; i++) {
118 var channelCode = records[i].get('channelCode');
119 var index = store.find("channelCode",
120 channelCode);
121 store.removeAt(index);
122 }
123 }
124 });
125 } else if ("customized" == temp || "default" == temp) {
126 store2.removeAll();
127 }
128 }
129
130
131 var channelCode = Ext.getCmp("myIt").getValue();
132
133 获取右边的所有值