When ComboBox is used, it has a hiddenname attribute, which is used to submit the value of value in ComboBox.
Assume that the ID of a ComboBox is comboid, and the value of the hiddenname attribute is hiddenvalue,
So,
UseExt. Get ('comboid'). Dom. ValueThe method obtains the text of the selected items in ComboBox.TextValue,
Ext. getcmp ("ID value"). getvalue (); Obtained isValueValue
. Replace (// \ s/g, ""); // remove all line breaks, spaces, and tabs in JSON text;
========================================================== =
Extjs executes the button click event and the handler event.
The simplest way is to view the HTML code Dom generated by extjs and find the corresponding generated ID
For example:
Method 1:VaR BTN = Document. getelementbyid ("ext-gen40"); // The ext-gen40 here is the ID that extjs generates immediately, but sometimes this ID will change,
BTN. Click ();
Method 2:Ext. getcmp ('title2d '). fireevent ("click"); // here, "title2d" is the ID in extjs code.
Execute the button handler event:
VaR btn2d = ext. getcmp ("title2d ");
Btn2d. handler. Call (btn2d. Scope, btn2d );
Reference URL: http://www.sencha.com/forum/showthread.php? 25677-2.0.1-fireevent % 28-click-% 29-on-buttons-don-t-call-handler-function
Onclick is a method, while handler is a configuration item
Differences between extjs onclick and handler: http://blog.csdn.net/21aspnet/article/details/6865571
========================================================== ================ Get the value of the text box
1. HTML text box
For example, <input type = "text" name = "test" id = "test">
The method to obtain the value is:
VaR tvalue = ext. getdom ('test'). value;
Or
VaR tvalue = Document. getelementbyid ('test'). Value
2. extjs Components
Example :{
ID: 'test ',
Xtype: 'textfield ',
Fieldlabel: '& nbsp; test ',
Name: 'test ',
Width: 370
}
The method to obtain the value is:
VaR tvalue =Ext. getcmp ('test'). getvalue ();
Ext. Get ('test'). Dom. Value
Set the value of the text box
Ext. getcmp ('test'). setvalue ("Set Value ");
============================================ Enable and disable the button
Ext. getcmp ('btnqc '). Disable (); // disable
Ext. getcmp ('btnqc '). Enable (); // enable
Method 1: You can directly give the property when defining the bbar button. The property "hidden: True" can be hidden. The property "Disabled: True" can be disabled.
Method 2: add an ID to the button, for example, ID: 'btn '. Then, call ext in the panel event. getcmp ('btn '). disable (); Disabled or ext. getcmp ('btn '). enable (); enabled. Ext. getcmp ('btn '). setvisible (false); hide or ext. getcmp ('btn'). setvisible (true); display.