Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Getting the values for all items (including unselected ones) for igCombo in Javascript/JScript
posted

I need to get all the values (as a list or array) in an igCombo. I think I need to begin the statement with this:

var allParcelYears = $("ddlYearParcelsValuations").igCombo("listItems");

However, I cannot find anywhere how to proceed with the syntax. Data, value, and text seem to be keywords I need but no variation I've tried has worked.

Parents
No Data
Reply
  • 640
    Offline posted

    Hello John,

    Thank you for posting in our community.

    The listItems method of igCombo returns reference to jQuery objects representing all rendered list items in the combo drop down list. What I can suggest in order to get the data of the all combo's items is using the items method that returns array with objects containing following members: data - the associated data, element - the jquery element of the li:

    var items = $(".selector").igCombo("items");
    var firstItemData = items[0].data;
    var $firstItemLi = items[0].element;

    I have created a small sample illustrating my suggestion, which you can find here. Please test it on your side and let me know wether you find it helpful.

    Please let me know if I could be of any further assistance.

    Regards,
    Viktor Kombov
    Entry Level Software Developer
    Infragistics, inc.

Children
No Data