// 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 });