hide columns dinamic if the data row is specitic
hide columns dinamic if the data row is specitic
ThomasFerraz
Posts: 7Questions: 3Answers: 0
Hi all, i have a problem with a Datatables.
Normally i hide specific column but now i need a hide a column If the information in the column is specific.
Example: if my column 7 have a information "99" i need hide this column.
I dont find anything google or another forum about this.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I would look at using
filter()
to get the data that contains "99" in column 7. If there is a result then hide the column. The first example in the doc page can be modified for your specific rules.Kevin
Kevin, tks.
But do you have a example of use the filter()?
I look the documentation but i dont undertand the use after load my datable
i need used the filter after the ajax load the data to my datatable.
my code:
function CarregarGridProgramaGoverno(ProgramaGoverno)
{
try {
var tbGridProgramaGoverno = $("#GridProgramaGoverno");
var dataObject = ProgramaGoverno;
}
Here is an example:
http://live.datatables.net/nalotira/1/edit
There are two buttons; One that looks for "Director" (which is in the column) and the other looks for "CEO" (which is not in the column).
Click the buttons. The column will be hidden if the data is found or shown if not.
Kevin
tks man its working now.