Hide Row By Default
Hide Row By Default
bryceray1121
Posts: 65Questions: 0Answers: 0
I currently have my table setup so that some columns are hidden by default. When a button is clicked the columns become visible. I accomplished this by adding a class to the desired columns and setting aoColumnDefs to "bVisible":false, "aTargets" : ["dataTables_notVisible"].
Now I want to do the something except with rows instead of columns. One of the data columns in my table is active/inactive. When I load the page I will parse a row, if it contains an 'inactive' status I will add a class to the tr element for that row.
How can I use datatables to:
a)Hide a row on page load based on whether it contains the predefined class
b)Toggle the visibility of that row on button press.
Will I have to use some combination of: fnDeleteRow and fnAddRow? Or is there a cleaner way to do this?
Thanks for the help.
Now I want to do the something except with rows instead of columns. One of the data columns in my table is active/inactive. When I load the page I will parse a row, if it contains an 'inactive' status I will add a class to the tr element for that row.
How can I use datatables to:
a)Hide a row on page load based on whether it contains the predefined class
b)Toggle the visibility of that row on button press.
Will I have to use some combination of: fnDeleteRow and fnAddRow? Or is there a cleaner way to do this?
Thanks for the help.
This discussion has been closed.
Replies
Thanks.