jQuery UI Widgets Forums Lists ListBox Problem with json & checkboxes

This topic contains 2 replies, has 2 voices, and was last updated by  lior 12 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Problem with json & checkboxes #6864

    lior
    Member

    Hi.
    I created jqxListBox objet by this code:
    $("#test").jqxListBox({ source: source, checkboxes: true, width: 170, height: 80, theme: theme });

    source look like that:

    var source = [{"label":"a","value":"1"},{"label":"b","value":"2"},{"label":"c","value":"3"},{"label":"d","value":"4"},{"label":"e","value":"5"},{"label":"f","value":"6"}];

    How can i get the selected items?
    The “getSelectedItems” methods always receive me one item.
    var items = $("#test").jqxListBox('getSelectedItems');

    Thanks!

    Problem with json & checkboxes #6878

    Dimitar
    Participant

    Hello lior,

    If you wish to get the checked items, use the method getCheckedItems.

    var items = $("#jqxListBox").jqxListBox('getCheckedItems');

    In your case you have only one selected item and multiple checked ones. If you wish to be able to select multiple items, then you have to set the property multiple to true.

    $("#jqxListBox").jqxListBox({multiple: true});

    Then you may call the getSelectedItems method.

    Best Regards,
    Dimitar

    jqWidgets team
    http://www.jqwidgets.com/

    Problem with json & checkboxes #6901

    lior
    Member

    Thanks! 🙂

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

You must be logged in to reply to this topic.