ColVis & server-side processing

ColVis & server-side processing

rafraf Posts: 1Questions: 0Answers: 0
edited March 2012 in Plug-ins
First, congratulations for DataTable that is very powerful and flexible tools! I worked a good part of the week by coupling it with ColVis, TableTools and KnockOut and I could solve all my problems through this forum.

Except one: ColVis causes a request to the server every change columns. Which means in my case a very expensive and unnecessary treatment. So I modified the code Colvis and I wanted to have your opinion on this change...

[code]
"_fnDomColumnButton": function (i) {
...
$(nButton).click(function (e) {
...
// that.s.dt.oInstance.fnSetColumnVis(i, showHide);
// FIX: do not call server
that.s.dt.oInstance.fnSetColumnVis(i, showHide, false);
that._fnDrawCallback();
...
[/code]

thanks, raf.

Replies

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin
    Seems fair. The main reason DataTables does a redraw is that it will allow the column resizing to run - if you don't want it to hit the server you can pipe line your data: http://datatables.net/release-datatables/examples/server_side/pipeline.html .

    But your method is valid as well :-)

    Allan
This discussion has been closed.