Ext. Form. ComboBox simple usage

Source: Internet
Author: User

// A two-dimensional array that stores the value and text of the Year and displays the text.
VaR year = [['20160301', '20160301'], ['20160301', '20160301'], ['20160301', '20160301'],
['123', '123'], ['123', '123'], ['123', '123'],
['123', '123'], ['123', '123'];

// Simplestore = store + memoryproxy + arrayreader

VaR storeyear = new Ext. Data. simplestore ({
// Two columns of data are created here. The first column is named value, which is used to store values.
// The Name Of The second column is text, which is used to store the displayed text.
Fields: ['value', 'text'],
Data: Year
});

VaR yearcombox = new Ext. Form. ComboBox ({
Fieldlabel: 'Target year', // tag

// Hiddenname: indicates the hidden domain name used to generate a form hidden domain. If you change hiddenname to name, the text value will be passed when the value is passed.
Hiddenname: 'Year ',
Store: storeyear,

// Displayfield: display text. The name must be the same as that defined by storeyear.
Displayfield: 'text ',

// Valuefield: value. The name must be the same as that defined by storeyear.
Valuefield: 'value ',
Typeahead: True,

// Mode: the value of local indicates that the data required by yearcombox has been read locally and does not need to be read in the background.
// The default mode is remote. When the value is remote, data is loaded by default. You can set the mode to local, and then manually load the data storeyear. Load ()
// If storeyear. Load () is used again when it is set to remote, it will read twice
Mode: 'local ',

// Triggeraction: The default value is query. If the value is query, it uses the autocomplete function.
// Filter out unmatched items during input. If the value is all, all lists will be displayed.
Triggeraction: 'all ',

Editable: false, // editable, similar to the readonly attribute
emptytext: 'Please select', // default message
allowblank: false, // whether null is allowed
blanktext: 'cannot be blank. Please select valid information', // error message
msgtarget: 'under ', // The error message
selectonfocus: True,
width: 200 // width of the ComboBox component
} is displayed below the component });

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.