jquery - datatables dynamically hide/show column too slow -
my goal show/hide columns dynamically using datatables jquery plugin. when have around 500 rows takes forever it. i'm using new datatables api 1.10.0.
$('#oats-detailed-view-button').click(function (e) { e.preventdefault(); oatstable.columns([6,7,8,9,10,11,12]).visible(true); });
is there more efficient way it?
having performance issues, suggest in general these steps:
- remove unnecessary data
- alter options of service object
- try using service object in way
- workaround , debugging service object (if open source, i.e. inform producer findings)
- agree producer solve problem, or use service object
to 1: sure have no unnecessary attributes, texts , events concerning cells?
to 2: here hint of setting autowidth
false, didn't in other thread. performance issues when hiding columns in jquery datatables
in options of datatables api, there 1 further possibility influencing performance: deferrender
: http://datatables.net/reference/option/deferrender -> sure columns made visible? maybe browser has create html first, not created while loading?
further, in datatables manual/faq explanation of speeding table altering way it's built: http://datatables.net/faqs/index (scroll down "datatables running slow").
to 3 , 4: think of having 2 html div
containers seamlessly laying beside. div
1 contains columns 1 5, div
2 contains columns 6 12. switching div
2 on , off, columns visible/invisible @ once. imagine if use visibiliy:hidden
, not display:none
, browser doesn't have render new.
Comments
Post a Comment