jQuery UI Widgets Forums Lists ComboBox jqxcombobox doesn`t select item

This topic contains 3 replies, has 2 voices, and was last updated by  ivailo 8 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • jqxcombobox doesn`t select item #81231

    Huseyn
    Participant

    jqxcombobox doesn`t select item. What is the problem here

    [ {“p_level”:1,”p_name”:”11″,”p_id”:1}, {“p_level”:2,”p_name”:”22″,”p_id”:2}, {“p_level”:3,”p_name”:”33″,”p_id”:3}, {“p_level”:4,”p_name”:”44″,”p_id”:4}, {“p_level”:5,”p_name”:”55″,”p_id”:5} ]

    var url = “PriorityController.jsp”;
    var source =
    {
    datatype: “json”,
    datafields: [
    {name: ‘p_id’},
    {name: ‘p_level’},
    {name: ‘p_name’}
    ],
    url: url,
    async: false
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $(“#req_prio2”).jqxComboBox({source: dataAdapter, displayMember: “p_name”, valueMember: “p_id”, theme: ‘bootstrap’, width: 200});
    $(“#req_prio2”).jqxComboBox(‘selectItem’, ’33’ );

    jqxcombobox doesn`t select item #81236

    ivailo
    Participant

    Hi Huseyn,

    You can use selectItem method with the valueMember values.
    Please look at this demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    jqxcombobox doesn`t select item #81243

    Huseyn
    Participant

    How to use displayMember item select?

    jqxcombobox doesn`t select item #81249

    ivailo
    Participant

    Hi Huseyn,

    Like a workaround you can use the relation between displayMember and valueMember fields in your source.
    With for loop find the object with displayMember value in your source, get the corresponding valueMember and use it in selectItem method

    Please look at this demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.