Ext js: What is ComboBox? How to use it? -Strong 2nd

Source: Internet
Author: User

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

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.