Extj combobox setValue display problem

Source: Internet
Author: User

English version (ext ext-4.1.1)

Problem: In this case, the default combobox is required to display a fixed value, and the setValue (key) method is used to assign values. However, the key is displayed, instead of the value corresponding to the desired key.

Cause: js itself is of a weak type, but extjs distinguishes the types. Therefore, when setValue (key) is used, you must pay attention to the key data type in combobox. The premise of setValue () is that the data in combobox has been loaded. If there is no data in combobox, using setValue (key) will also directly display the key.

Solution: Before using setValue (key), 1 must ensure that there is correct data in combobox, 2: the data type of the hidden value (key) corresponding to combobox and setValue (key) the keys in are of the same type. 123 and '123' are not equal in the setValue () method of ext.

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.