jQuery UI Widgets › Forums › Grid › topic deleted
Tagged: datagrid
This topic contains 4 replies, has 3 voices, and was last updated by Serdar 4 years ago.
-
Authortopic deleted Posts
-
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); } }) });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 StoevjQWidgets Team
https://www.jqwidgets.com/Thank you for the answer. Can you give a sample code?
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 abeginupdatemethod and end withendupdatemethod, which improves performance when making multiple changes at once.Best regards,
Ivan Peevski
jQWidgets Team
https://www.jqwidgets.comthank you
-
AuthorPosts
You must be logged in to reply to this topic.