1

First off, thanks for your patience I'm pretty new to Ext. All I'm trying to do is get the value of a hidden form field on an HTML page and store its value a variable inside an ext script. Here's what I'm working with: HTML PAGE:

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

Ext Page:

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

3 回答 3

3

这是最合适的:

var hidden = Ext.getCmp('accountID');
var hiddenValue = hidden.getValue();
于 2013-07-09T04:52:06.987 回答
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();
于 2014-03-13T12:09:57.967 回答
1

你可以得到这样的值:

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

检查这个例子:Jsfiddle

于 2013-07-09T15:49:20.550 回答