2013-07-09 110 views
1

首先,感谢您的耐心我是Ext的新人。我所要做的就是在HTML页面上获取隐藏表单域的值,并将其值存储在ext脚本中。这里就是我的工作: HTML页面:ExtJS获取隐藏表单域的值

<form name="myForm"> 
<input type="hidden" id="accountID" name="divAccountID" value="463"> 
</form> 

内线页:

var myAccountID = Ext.ComponentQuery.query('panel[name=myForm] #accountID'); 
+0

我使用EXTJS 4 – user1431633

回答

1

你可以得到这样的价值:

var v = Ext.get('accountID').dom.value; 

Check thi榜样:Jsfiddle

3

这是最合适的:

var hidden = Ext.getCmp('accountID'); 
var hiddenValue = hidden.getValue(); 
2
var win = Ext.widget('nameofviev'); 

//The above line will find the view in which we want to find the hidden fields 

    win.down('hidden#row_id').setValue(index); 

//The above line set the value of hidden field that's `id` is `row_id`. 
//If we remove the `#row_id` it find first hidden field and set value of that 

//或

var hidden = Ext.getCmp('accountID'); 
var hiddenValue = hidden.getValue();