jQuery UI Widgets Forums Grid topic deleted

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  Serdar 2 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • topic deleted #121264

    Serdar
    Participant

    hello I can’t open a topic, it’s being deleted
    I’ve created this thread many times but I can’t see it.

    hello I have 27 columns, when I hide or show ,the loop is very slow run(show/hide average of 5 seconds)

    but when i remove this the loop runs fast
    $("#" + $grid).jqxGrid('showcolumn', column);
    $("#" + $grid).jqxGrid('hidecolumn', column);
    What is the reason?
    How can I hide and show all columns without looping?
    thank you
    example image
    https://ibb.co/RQJ8SVs

    $('#GridColumnCheck').off('change');
    $(document).on("change", "#GridColumnCheck", function (event) {
        event.stopPropagation();
        var chk = $(this).nextAll(".chk");
        var $grid = $(this).attr("data-grid");
        var checked = this.checked;
       
        debugger
        $.each(chk, function (index, value) { 
            
            var column = $(this).attr("data-column");
            if (checked) {
                $(this).jqxCheckBox({ checked: true });
                $("#" + $grid).jqxGrid('showcolumn', column);
            }
            else { 
                $(this).jqxCheckBox({ checked: false });
                 $("#" + $grid).jqxGrid('hidecolumn', column);
            } 
        })
    
    });
    topic deleted #121270

    admin
    Keymaster

    Hi Serdar,

    The jqxGrid does not have API to hide or show all columns at once and looping will be necessary if you want to have such an action. My suggestion however would be to add beginupdate before the loop and endupdate after it. By doing that your Grid will stop the rendering, hide/show all columns in a loop and resume the rendering.

    Best regards,
    Peter Stoev

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

    topic deleted #121276

    Serdar
    Participant

    Thank you for the answer. Can you give a sample code?

    topic deleted #121283

    ivanpeevski
    Participant

    Hi Serdar,

    Please have a look at the example here for a sample code: https://jsfiddle.net/tu057d4f/
    You will see that all operations begin with a beginupdate method and end with endupdate method, which improves performance when making multiple changes at once.

    Best regards,
    Ivan Peevski
    jQWidgets Team
    https://www.jqwidgets.com

    topic deleted #121301

    Serdar
    Participant

    thank you

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

You must be logged in to reply to this topic.