jQWidgets Forums

jQuery UI Widgets Forums Grid Grid checkbox selection hangs

This topic contains 2 replies, has 2 voices, and was last updated by  Reltik 10 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Grid checkbox selection hangs #63535

    Reltik
    Participant

    Hi everyone, this is my first post. I’m posting this because I have a doubt and maybe you can help me.

    Your grid works wonderful. Its a pretty nice widget. But, there’s a but, and I think it’s probably my fault.

    I’m playing with a random selection mode, based on a “checkbox” selectionmode and a random limit.

    After checking your documentations and examples, I only see one way to select programmatically items, and this is by using $(“#grilla”).jqxGrid(“selectrow”, index)

    It works fine, but when you are using a large set of data ie 1000 records, it just hangs for a few seconds. At beginning, i think was probably because for each item I check, it has to be rendered (only visibile items at least, but it don’t work neither, even with paging and 5 items per page). So I try with beginupdate and endupdate, without success.

    Is there anyway to check a large set of items without hang the browser??

    Here’s is a snippet of the code that I use:

    
    var ItemsLimit = 1000;
    
    // aleatory items
    var ToSelect = rows.concat().sort(function () {
          return 0.5 - Math.random()
    });
    
    var contador = 0;
    ToSelect.some(o => {
        if (contador < ItemsLimit) {
            $grilla.jqxGrid("selectrow", o.uid);
            contador++;
        } else {
           return true;
        }
    });

    Cheers

    Grid checkbox selection hangs #63551

    Peter Stoev
    Keymaster

    Hi Reltik,

    Calling beginupdate before and endupdate after your selection logic should be fine. However, it would be good to disable the updating of the checkbox selection during the update process by passing additonal param to the “selectrow” method call. Example for selection 1000 rows using “selectrow” Grid method: http://jsfiddle.net/f8gsktm5/

    Hope this helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid checkbox selection hangs #63599

    Reltik
    Participant

    Hi Peter, it works like a charm! Thank you very much!

    When you can, please add that third parameter of “selectrow” at the api docs

    http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm

    Cheers,
    Emanuel.

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

You must be logged in to reply to this topic.