jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox Index number checked ListBox

This topic contains 2 replies, has 2 voices, and was last updated by  lsmarco2008@gmail.com 11 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Index number checked ListBox #52735

    Hello,

    I am not able get the index number of the options clicked ListBox (jqWidgets).
    Note: I am using true multiple checkbox

    My code:

    i = Len ($ (“# ListBox1”). jqxListBox (“getCheckedItems”))
       For n = 1 To i
         s = $ (“# ListBox1”). jqxListBox (“getSelectedIndex”) [n-1]. value
         j = j & “” & s
        Next
       Print & j

    Index number checked ListBox #52740

    Peter Stoev
    Keymaster

    Hi lsmarco2008,

    getCheckedItems returns an Array of Items and each item has Label and Value fields. That means that your FOR loop should look like:

          var items = $("#jqxListBox").jqxListBox('getCheckedItems');
          for(var i = 0; i < items.length; i++)
          {
               var item = items[i];
               alert(item.label + ", " + item.value);
          }

    Hope this helps.

    Best Regards,
    Peter Stoev

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

    Index number checked ListBox #52791

    Thanks!

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

You must be logged in to reply to this topic.