Datatables on-the-fly resizing

后端 未结 12 2237
灰色年华
灰色年华 2020-12-12 16:21

I\'m using the marvellous DataTables jQuery plug-in; http://datatables.net/ Added the FixedColumns and KeyTable extras.

Now the table does resize prettily when the

12条回答
  •  孤街浪徒
    2020-12-12 16:51

    I was having the exact same problem as OP. I had a DataTable which would not readjust its width after a jQuery animation (toogle("fast")) resized its container.

    After reading these answers, and lots of try and error this did the trick for me:

      $("#animatedElement").toggle(100, function() {    
        $("#dataTableId").resize();
      });
    

    After many test, i realized that i need to wait for the animation to finish for dataTables to calculate the correct width.

提交回复
热议问题