读书人

ext comboBox 设立 displayFiled

发布时间: 2012-11-23 00:03:43 作者: rapoo

ext comboBox 设置 displayFiled

var zhishi = new Ext.form.ComboBox({fieldLabel : '制式',name : 'system',emptyText:'请选择...',readOnly : true,valueField :'systemId',displayField : 'systemLcName',mode : 'local', // 必须//triggerAction : 'all',width : 140,store : new Ext.data.Store({autoLoad : true,proxy : new Ext.data.HttpProxy({url : 'ruleOper.do?action=getAllSystem',method : "post"}),reader : new Ext.data.JsonReader({root : 'list',id : 'systemId'}, [{name : 'systemId'}, {name : 'systemLcName'}])})});zhishi.store.on('load',function(store,record,opts){      var myvalue= record[0].data.systemId;//这种方法也可以获得第一项的值systemId,systemLcName都是reader 得  var myrawvalue=record[0].data.systemLcName;  zhishi.setValue(myvalue);  zhishi.setRawValue(myrawvalue);  });   




读书人网 >Web前端

热点推荐