jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox Add icon dynamically

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Add icon dynamically #23299

    Mhanna AbuTareef
    Participant

    Hi,

    How to add icons dynamically to the ListBox items, in case of using items in {label: ”, value: ”} form?

    Regards,

    Mhanna

    Add icon dynamically #23303

    Mhanna AbuTareef
    Participant

    Hi,

    Actually, i need to know how to dynamically show/hide that icons?

    Regards,

    Mhanna

    Add icon dynamically #23373

    Peter Stoev
    Keymaster

    Hi,

    You can dynamically add new items by using the jqxListBox’s “addItem” method. If you wish to later update an item, use the “updateItem” method. updateItem accepts two parameters – the new item and the old item. You can get the old item by using the “getItem” method. The new item should be in the format: {label: “My Item”, value: “My Value”}. In case you wish to insert HTML, use {html: “My HTML“}.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Add icon dynamically #23423

    Mhanna AbuTareef
    Participant

    Hi,

    In case i want to use html (because i need icon near the item), how could i attach value for this item?

    Regards,

    Mhanna

    Add icon dynamically #23460

    Peter Stoev
    Keymaster

    Hi,

    To attach a value to an item, you need to set its “value” field.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.