[英]SetValue to a variable in a form Extjs
我的表單中有以下代碼:
var code = I want to assign the codigoEmpresa value !!
{
xtype: 'textfield',
name: 'codigoEmpresa',
itemId: 'codigoEmpresa',
hidden: true,
hideable: false,
},
{
xtype: 'combobox',
x: 120,
y: 5,
width: 250,
fieldLabel: 'Empresa',
name: 'empresa',
labelWidth: 60,
itemId: 'comboEmpresa',
emptyText: 'Seleccione Empresa',
displayField: 'nombre',
valueField: 'id',
store: new Ext.create('SgaWeb.store.comunes.Empresas'),
queryMode:'local',
editable: false,
},
{
xtype: 'textfield',
name: 'codigoDepartamento',
itemId: 'codigoDepartamento',
hidden: true,
hideable: false,
},
{
xtype: 'combobox',
x: 390,
y: 5,
width: 280,
fieldLabel: 'Departamento',
labelWidth: 90,
name: 'departamento',
itemId: 'comboDepto',
queryMode: 'local',
emptyText: 'Seleccione Departamento',
displayField: 'nombre',
valueField: 'id',
store: new Ext.create('SgaWeb.store.comunes.Departamentos'),
editable: false,
},
我需要將codigoEmpresa的值分配給一個變量。 如何以相同的形式進行此操作? 我需要以這種形式將該變量用於其他目的,但我不知道如何獲取codigoEmpresa的值並將其設置為變量
var codigoEmpresaValue = this.getForm().findField('codigoEmpresa').getValue();
表單的范圍需要調整(this,this.down(),this.up())
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.