1. 程式人生 > >extjs中combox獲取顯示值

extjs中combox獲取顯示值

很多人問怎麼獲取combobox中的顯示值,其實很簡單,使用getRawValue()即可。

例:

{
id : 'manager',
xtype : 'combo',
value : '',

displayField : 'name',

valueField : 'id',
。。。
listeners: {
           select: function() {
                          Ext.Msg.alert(this.getRawValue());   //顯示選中的name值

 Ext.Msg.alert(this.getValue());  //顯示選中的id值

。。。。

}