jQuery UI Widgets Forums Lists DropDownList insert item with value

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • insert item with value #15103

    taraman
    Member

    I need to insert an item at the top of the dropDownList:
    label= “Select All” and value = “-1”

    this example is good:
    $(“#jqxDropDownList”).jqxDropDownList(‘insertAt’, ‘Select All’, 0 );

    but, we can only add item with label, How can I add value for this new item

    insert item with value #15119

    Dimitar
    Participant

    Hello taraman,

    It is not that a value is not added, it just is the same as the label. If you pass an object as a parameter, you can add an item with distinct label and value. E.g.:

                    itemInfo = { label: 'Label0', value: 'Value0' };
    $("#insert").click(function () {
    $("#jqxWidget").jqxDropDownList('insertAt', itemInfo, 0);
    });

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.