Home >
Web Front-end >
JS Tutorial >
Detailed explanation of the case of taking value and text from extjs3 combobox_extjs
Detailed explanation of the case of taking value and text from extjs3 combobox_extjs
WBOY
Release: 2016-05-16 17:41:55
Original
1406 people have browsed it
When using combobox, it has a hiddenName attribute, which is specially used to submit the value of the value in the combobox. Now assume that the Id of a combobox is comboId, and the value of the hiddenName attribute is hiddenValue, Then, what you use the Ext.get('comboId').dom.value method to get is the text value of the selected item in the combobox, and what you use Ext.get('hiddenValue').dom.value is. It is the value that needs to be submitted in the combobox. Ext.getCmp("ID value").getValue(); What is obtained is the Value value .replace(/s/g, ""); //Remove all line breaks and spaces in the json text , tab; ============================================ Extjs executes the click event of the button and the handler event The easiest way is to look at the html code dom generated by extjs and find the corresponding generated ID For example: Method 1:
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(-click-)-on-buttons-don-t-call-handler-function onClick is a method , and handler is a configuration item The difference between extjs onclick and handler: http://blog.csdn.net/21aspnet/article/details/6865571 ============= ======================================= Get the value of the text box 1 , Html text box such as:
Method 1: You can directly add attributes when defining the button of bbar. The hidden : true attribute can be hidden; the disabled : true attribute can be disabled. Method 2: Add an id to the button, such as id:'btn'; then in the panel Call Ext.getCmp('btn').disable(); to disable or Ext.getCmp('btn').enable(); to enable in the event. Ext.getCmp('btn').setVisible (false); hide or Ext.getCmp('btn').setVisible (true); display.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn