导航

Ext combo 填充显示值与实际值问题

Posted on 2013-04-18 13:24  小强有毒  阅读(320)  评论(0)    收藏  举报
//将数据填充到combobox中,
New Ext.form.ComboBox({   fieldLabel:
'供应商',   editable : false,   triggerAction : 'all',   redafter : true,   hiddenName:'smt.supplier.id',//表单提交到后台的name   hiddenValue:row.get('supplier.id'),//填充实际值   value:row.get('supplier.name'),//填充显示值   displayField : 'name',//显示值,绑定到store中的数据   valueField : 'id',//实际值,绑定到srore中的数据
  mode :
'remote',   blankText : '请选择供应商',   store : new Ext.data.Store({     url : 'getSupplierList.do',     reader : new Ext.data.JsonReader({       root : 'list'     },[       {name : 'id',type : 'string'},       {name : 'name',type : 'string'}     ])   }) })

以上实例适用于修改,数据填充到下拉中.
而如果是添加则去掉 hiddenValue 以及Value属性即可