jQuery UI Widgets Forums Lists DropDownList v3.0.1 checkAll fires multiple checkChange Events

Tagged: 

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

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

  • arajput
    Member

    I just upgraded from v2.8.3 to v3.0.1 and started noticing a very strange behavior in my application.

    I have a drop down list with entries like ‘ALL, Item1, Item2, Item3’ and have enabled check boxe selection using property
    ‘checkboxes: true’

    User can check ALL to enable selection for all the entries available.

    Internally I check all the boxes using the API and then initiate some business logic, excerpt shown below

    var that = this;
    $(‘#tms’).on(‘checkChange’, function (event) {
    var item = event.args.item;

    if(item) {
    // Handle ‘ALL’ case
    if(item.value===’ALL’)
    {
    // Handle checked case
    if(item.checked===true)
    {
    // Check all the entries
    $(‘#tms’).jqxDropDownList(‘checkAll’); // Problematic call in v3.0.1

    // Business logic processing, initiates ajax call to server
    that.onTradingMemberChange(‘ALL’);
    return;
    }
    }
    }
    });

    in v2.8.3 this was working perfectly fine but in the latest version 3.0.1 as soon as I call .jqxDropDownList(‘checkAll’), multiple checkChange events are getting fired, one for each entry in the drop down.

    Is this a bug introduced in 3.0.1? Can someone please take a look at the change in behavior.

    Thank you
    Ashish


    Peter Stoev
    Keymaster

    Hi Ashish,

    That is actually intentional. It was a bug that the event was not raised when the “checkAll” method was called.

    Best Regards,
    Peter Stoev

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


    arajput
    Member

    Peter,
    How do you suggest we handle multiple calls to the ‘checkChange’ event handler? I have 234 items in the list and the checkAll is making my handler to be called 234 times!
    Is there a ‘slient’ configuration? or any other alternative?
    Since this is an API call to check/uncheck of all the boxes, i don’t see why it should trigger checkChange for every item in the list.
    That’s my opinion, I have a feeling you disagree 🙂

    Ashish


    Peter Stoev
    Keymaster

    Hi Ashish,

    The arguments of the “checkChange” event depend on each item and it is raised for each item. You can add a boolean flag and apply or not apply your logic in the event “checkChange” event handler. I suppose that you know when you call the “checkAll” method in your code.

    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.