您的位置:首页 > 其它

EditorGridPanel 下拉框编辑,显示值,隐藏值问题

2013-05-30 09:44 429 查看
editor : new Ext.form.ComboBox({
  allowBlank:false,
  editable:false,
  blankText : '采购单位不能为空',
  triggerAction : 'all',
  valueField : 'id',
  displayField : 'name',
  mode : 'remote',
  getRawValue:function(){//重写getRawValue()方法使其获取显示值
    if(this.valueField){
      return Ext.isDefined(this.value)?this.value:"";
    }else{
      return Ext.form.ComboBox.superclass.getValue.call(this);
    }
  },
  getValue:function(){//重写getValue()方法使其获取隐藏值 //在EditorGridPanel中,combo调用的是此方法,但是只能获取隐藏值
    var a = this.rendered?this.el.getValue():Ext.value(this.value,"");
    if(a===this.emptyText){
      a="";
    }
      return a;
    },
  store : new Ext.data.Store({
    url : '${ctx}/admin/getDictionaryList.do?code=MeasureUnit',
    reader : new Ext.data.JsonReader({
      root : 'list'
    },[
      {name : 'id',type : 'string'},
      {name : 'name',type : 'string'}
    ])
  }),
  listeners:{
    'select' : function(e){

    }
  }
})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: