show extra / detailed information... How to set default Content
show extra / detailed information... How to set default Content

Hello every one! Was searching for a way to set a default value for a atribute of my table that is hidden in the show extra / detailed information Button.
i know i can set it like this when it is in a normal Table
$('#example').dataTable( {
"columns": [
null,
null,
null,
{
"data": "first_name", // can be null or undefined
"defaultContent": "<i>Not set</i>"
}
]
} );
How should i set it for hidden atributes/columns???
Would i be able to hide button if value/atribute that is hidden is Null???
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Can you link to an example please? I don't see any code above that shows how you are displaying the details, so I'll need a lot more to go on than the above.
ALlan
Hello @allan !
i am using this code as a sample...
http://live.datatables.net/bihawepu/3330/edit
Would like to put a default text if one of the atributes in the details is null,
Or even better as i have only one atribute hidden to be able to hide the button if value is null... it´s not worth clicking if there is no extra info!
Hi @Pedro Martins ,
You can use
createdRow
to remove the '+' sign - see example here. If you look at the third line, the '+' is gone. You could do the same, with extra logic for whatever your criteria is.For each individual line, you can modify that in your
format()
function,Cheers,
Colin
Hi, I'm new in php. I would like to know on how can I fetch the data from the database and display it on the Datatables with show/hide extra detail information.