2013-07-09 109 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();