EXTJS ComboBox 获取displayField 值

var s_ds = new Ext.data.Store({
     proxy : new Ext.data.HttpProxy({
        url : url,
        timeout : 15000
       }),
     autoLoad : true,
     reader : new Ext.data.JsonReader({}, ['id', 'longName','currentFlag']),
     listeners : {
      load: function() { 
               sessionCombo.setValue(_sessionid); 
               bulkUploadGrid.grid.sessionId = _sessionid;
           }
     }
    });

var sessionCombo = new Ext.form.ComboBox({
    hideLabel : false,
    fieldLabel : '届次',
    hiddenName : 'sessionid',
    name : 'sessionCombo',
    id : 'sessionCombo',
    emptyText : '',
    store : s_ds,
    displayField : 'longName',
    valueField : 'id',

    value : '',
    mode : 'romote',
    triggerAction : 'all',
    editable : false,
    width : 88,
    selectOnFocus : true,
    listeners : {
     'select' : function(thisCombo) {
      bulkUploadGrid.grid.sessionId = thisCombo.getValue();
     }
    }
   });

 

 

var index = s_ds.find("id",sessionCombo.getValue());
var r = s_ds.getAt(index);
if(r)
  alert( r.get("longName"));

你可能感兴趣的:(ext)