jQuery UI Widgets Forums Lists DropDownList Build from unordered list?!

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Build from unordered list?! #1199

    Troy
    Member

    Hello,

    Can I build the DropDownList from unordered list like your Tree widget?

    Greetings,

    Troy.

    Build from unordered list?! #1215

    support
    Participant

    Hi Troy,

    The requested feature is currently not implemented, but I added it to our TO DO list and we will definitely consider implementing it for a future version of our product. You can keep an eye on our Roadmap.

    You can use this workaround as a temporary solution until we implement the feature:

    1. Add the HTML markup for the unordered list.

            <ul id='unorderedlist'>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
    </ul>

    2. Create an Array object and Iterate through the LI elements saving each LI element’s text in the array.

    var items = new Array();
    $.each($($.find('#unorderedlist')).find('li'), function () {
    items[items.length] = $(this).text();
    });

    3. Set the source property to point to the items array.

    $("#jqxWidget").jqxDropDownList({ source: items, selectedIndex: 0, width: '200', height: '25'});

    Best Regards,
    Peter

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

You must be logged in to reply to this topic.