server-side + columnfilter + col width

server-side + columnfilter + col width

jd0000jd0000 Posts: 25Questions: 6Answers: 0
edited May 2011 in General
Hello ... im new to datatables ( was using tablesorter before) and its an amazing plugin. One thing I'm having some trouble with getting my column widths working after scrolling.
I am using server-side php to get more rows from my table, and bScrollInfinite to use infinite scrolling. When initializing the datatable, I'm using aoColumns and sWidth with a percentage to define the width of my columns since the auto sizing doesnt seem to work right. if I use the columnfilter plugin on the initialization, it doesnt accept my widths at all. So i have tried adding the .columnfilter in my ajax success callback right after calling fnCallback. And that works somewhat the first time. So after loading my page, my table is there with column widths as I set in aoColumns, there is data in the table and the columnFilter is in the footer -- however, the columnFilter column widths are off. Once i scroll down enough to cause more data from the server to get pulled in, the table is redrawn and the column widths are reset to match the (wrong) widths of the column filter.
Any suggestions on how to fix?

Thanks!

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Which version of DataTables are you using? The 1.8 beta series has some improvements in this regard over 1.7.x.

    Allan
  • jd0000jd0000 Posts: 25Questions: 6Answers: 0
    just now tried 1.8b4, its doing the exact same thing.
  • jd0000jd0000 Posts: 25Questions: 6Answers: 0
    so far my only work around is to get the widths of each column in my ajax success, after calling fnCallback but before adding the columnFilter (which only gets added after the first return). then after the columnFilter i go back through the table thead and the scroll foot table tfoot, setting each column back to the original width (and reducing width of the input elements in the footer). not sure this is a good way to be doing this but for the moment its working.
This discussion has been closed.