jQWidgets Forums

jQuery UI Widgets Forums General Discussions Lists DropDownList Add multiple items to dropDownList

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Add multiple items to dropDownList #59249

    Adarsha
    Participant

    Hi,

    I want to add multiple items into jqxDropDownList without loop.

    The addiItem example shown and as i tested with various ways, it is accepting only one record at a time to add into dropdown list.

    I have one field called weeks and preparing JSON at server side.. below are my questions

    1. I only have display member.. do i need to have value member as well?
    var source = {
    datatype: “json”,
    datafields:
    [
    { name: ‘weeks’ }
    ],
    localdata: json
    };
    var
    2. Server prepares JSON string and it looks like below, is it wrong way to prepare?
    json = {weeks:”200101″},{weeks:”200101″},….. etc
    $(“#jqxFromWeek”).jqxDropDownList(‘addItem’, json) – i wanted to add multiple weeks into dropdown list

    Add multiple items to dropDownList #59290

    Nadezhda
    Participant

    Hello Adarsha,

    1. “valueMember” is optional and you will decide if you need to have it.
    2. This is wrong way because “addItem” adds only one item to the jqxDropDownList. jqxDropDownList doen’s support adding multiple items.

    Best Regards,
    Nadezhda

    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.