上海源创会5月15日与你相约【玫瑰里】,赶快来约哦~!>>>
摘要
场景:我想获取combox中用户选取的值进行处理
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// 获取combox ID值
var
securityTypeIDValue = Ext.getCmp(
'securityTypeCombo'
).getValue();
// 获取显示值
var
securityTypeDisValue = Ext.getCmp(
'securityTypeCombo'
).getRawValue();
// Combox定义
/***************************Combox start*******************************/
var
securityTypeRecord=[
{name :
'SAVE_VALUE'
,type :
'string'
},
{name :
'DISPLAY_VALUE'
,type :
'string'
}
];
var
securityTypeRecordHeads = Ext.data.Record.create(securityTypeRecord);
var
securityTypeDatastore =
new
Ext.data.Store( {
proxy:
new
Ext.data.HttpProxy(
new
Ext.data.Connection({timeout:0,url:
'/customize/control/getZhengShangsecurityType'
})),
reader :
new
Ext.data.JsonReader( {
root :
'root'
}, securityTypeRecordHeads),
remoteSort :
false
});
securityTypeDatastore.load();
var
securityTypeCombo =
new
Ext.form.ComboBox({
id:
'securityTypeCombo'
,
width:110,
forceSelection :
true
,
selectOnFocus:
true
,
triggerAction:
'all'
,
mode:
'local'
,
store: securityTypeDatastore,
allowBlank:
true
,
valueField :
'SAVE_VALUE'
,
displayField :
'DISPLAY_VALUE'
,
emptyText:
'---请选择---'
});
/***************************Combox end *******************************/
|
声明:OSCHINA 博客文章版权属于作者,受法律保护。未经作者同意不得转载。