jQuery UI Widgets Forums Lists ListBox check vs select

Tagged: 

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • check vs select #6211

    fgaonet
    Member

    I am trying jqxListBox’s checking and selection functions. I noticed that a checked item is NOT a selected item.

    In API document, I see “checkedAll” and “uncheckedAll”, how about “selectAll”?

    I see “getSelectedItems”, how about “getCheckedItems”?

    How can I sync checked items with selected items? I mean:
    If an item is checked, let it be selected; and
    If an item is unchecked, let it be unselected; and
    If an item is selected, let it be checked; and
    If an item is unselected, let it be unchecked.

    Thanks,

    check vs select #6214

    Peter Stoev
    Keymaster

    Hi fgaonet,

    It is not necessary a selected item to be a checked item. However, you can use the jqxListBox’s events to synchronize the selected with checked items. The ‘select’ event is raised when an item is selected, the ‘checkChange’ is raised when the item’s checkbox state is changed.

    To get the checked items, you can do this:

                var checkedItems = new Array();
    $.each(this.items, function () {
    if (this.checked) {
    checkedItems[checkedItems.length] = this;
    }
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    check vs select #6243

    fgaonet
    Member

    Peter:

    Thank you for your reply! As my understanding to your anwser, I guess that jqxListBox has no built-in method of “selectAll” and “getCheckedItems” available. I need to build my own “selectAll” and “getCheckedItems” in “select” or “checkChange” event by loop each item. Am I correct?

    Thanks,

    check vs select #6272

    Peter Stoev
    Keymaster

    Hi fgaonet,

    We just added ‘getCheckedItems’ in jQWidgets 2.3.1. However, ‘selectAll’ is not supported. We’ll keep improving the selection behavior and its API in the future versions. We have plans to add keyboard selection with holding of “Shift” or “Ctrl” keys.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.