Extjs ComboBox usage notes

Source: Internet
Author: User
VaR combo = New Ext. form. comboBox ({ID: 'combo _ ', name: 'name', // name is just the name of the drop-down list hiddenname: 'id', // name of the Input submitted to the background, corresponding to the ''id in the following store, you must enter width: 80, store: store, // fill data emptytext: 'select', mode: 'local ', // data mode. Local indicates local data readonly: True, // whether read-only value: '', // default value, which must be set to the value submitted to the background, do not set to show text. Optional. triggeraction: 'All', // display all the following data. You must set properties.  Triggera Ction is all allowblank: false, // null valuefield: 'value', // value, optional displayfield: 'text', // display text, corresponding to the 'text', Editable: false in the following store, // whether to allow the input of forceselection: True, // You must select an option: blanktext: 'select' // If this option is not selected, an error message is displayed.}); var store = new Ext. data. simplestore ({fields: ['id', 'text'], data: [['1', 'octoken'], ['2', 'octoken'], ['3', 'August 11'], ['4', 'August 6'], ['5', 'August 6'], ['6', 'August 6'], ['7', 'August 11'], ['8', 'August 11'], ['9', 'August 11'], ['10 ', 'August 11'], ['11', 'August 11'], ['12', 'August 11']}); it took me half a day to perform various tests when setting the default value. I also referred to other methods on the Internet, but none of them succeeded. I was very depressed and finally found the method: the ID in ComboBox must be set and cannot be the same as the value of hiddenname. getcmp (ID value ). setvalue (value) can achieve the select effect in HTML. Note that the value here represents the number of items in store!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.