Dynamic Show/Hide not hiding header columns
Dynamic Show/Hide not hiding header columns
I am trying to implement the dynamic show/hide columns. It toggles the detail perfect, but the table headers are not hiding. I am hoping someone can point me in a good direction. have tried everything I know how to do at this point...
Thanks,
Gus
Below is a what my table header looks like.
<!--Table of Data-->
Facility
Description
Pounds Produced
Ingredients Used
Ingredients Loss
Pounds Shipped
Pounds Adjusted
Pounds Loss
Inventory Inc/Dec
Thanks,
Gus
Below is a what my table header looks like.
<!--Table of Data-->
Facility
Description
Pounds Produced
Ingredients Used
Ingredients Loss
Pounds Shipped
Pounds Adjusted
Pounds Loss
Inventory Inc/Dec
This discussion has been closed.
Replies
I don't see anything wrong with your THEAD element there, and my example ( http://datatables.net/examples/api/show_hide.html ) for fnSetColumnVis appears to be working okay. Can you post a link showing the issue?
Regards,
Allan
I was also using FixedHeader and that was causing this issue....
Thanks
Ah! What you need to do, if you are using FixedHeader, is when you call fnSetColumnVis, is just make a call to 'fnUpdate' on the FixedHeader object. That will update it for your newly hidden column :-)
Regards,
Allan
Sorry for the lack of understanding(not really a programmer), I have tried to do what you said to no avail.
So, I would do the fnUpdate call say here?:
function fnShowHide( iCol )
{
var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
oTable.fnSetColumnVis( iCol, bVis ? false : true );
//fnUpdate(oTable,aoData[iIndex],aoColumns[iCol],false); //??
};
Thanks for the help,
Gus
Yes that's basically correct. Although you need to call fnupdate on the FixedHeader object. $.fn.dataTableExt.FixedHeader.fnUpdate() should do it.
Regards,
Allan
Regards,
Allan