What is ComboBox of ext JS? To put it bluntly, it is the drop-down list + text, but more abundant!
How to use it?
Ext. onready (function () {var store = ext. create ("Ext. data. store ", {fields: [" abbr "," name "], data: [{" abbr ":" WBG "," name ":" wubangguo "}, {"abbr": "wjb", "name": "wenjiabao" },{ "abbr": "hjt", "name": "hujintao "}, {"abbr": "lks", "name": "likeshan"}], sorters: ["abbr"] // sort}); Ext. create ("Ext. form. comboBox ", {fieldlabel:" choose name ", store: store, // load the data source querymode:" local ", // if the data is local, it is best to use this option, this will help improve performance. The default situation is remote (note that the local option is also used when we return data to the local store through Ajax requests, because otherwise, the server will be requested one more time.) displayfield: "name", valuefield: "abbr", forceselection: True, // you can only select from the drop-down list. You cannot enter the text Editable: false, // editing is not allowed. (the default value is true) multiselect: True, // You can select multiple items in this case, multiple items are also displayed in ComboBox (false by default) listeners: {scope: This, "select": function (ComboBox, record, index) {Ext. array. each (record, function (item) {alert (item. get ("name") ;}); alert (ComboBox. getvalue (); // This is the value obtained, not the value where it is displayed.}, renderto: ext. getbody ()});});