jQuery UI Widgets Forums Lists ComboBox Setting Combobox Value

This topic contains 2 replies, has 2 voices, and was last updated by  4xjbh 8 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Setting Combobox Value #80768


    I have a combobox configured and it appears to be working correctly but when I try to set the value with $(“#company_id”).val( 46 ); it does not set. My source has a record with the id of ’46’.

    Other inputs, checkboxes, radio buttons are not a problem with .val(). Using (‘val’, ‘New Value’) does not work either. What could be stopping this from working.

    {“46″:”Ankunding-Reinger”,”19″:”Balistreri LLC”,”7″:”Bergnaum, Towne and Ryan”,”47″:”Bernhard PLC”,”22″:”Bode Group”}


    /* Company Select Box */
    var companylist =
        datatype: "json",
        datafields: [
            { name: 'id' },
            { name: 'name' }
        url: "../../company/companylist",
    var data_companylist = new $.jqx.dataAdapter(companylist);
                source: data_companylist,
                placeHolder: "Select a Company . . . ",
                displayMember: "name",
                valueMember: "id",
                height: inputHeight
    Setting Combobox Value #80775

    Peter Stoev

    Hi 4xjbh,

    As far as I see, you don’t have name and id members in that JSON. Do you even see any data in the ComboBox with that binding?

    Best Regards,
    Peter Stoev

    jQWidgets Team

    Setting Combobox Value #80786


    Yes there was combobox data with the binding. But you were correct, the lack of the attribute–value pair labels was the problem.

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

You must be logged in to reply to this topic.