"createdRow" function use to click button and it shows alert
"createdRow" function use to click button and it shows alert
che_jay
Posts: 8Questions: 3Answers: 0
Hi,
$(document).ready(function() {
$('#example').DataTable( {
"createdRow": function( row, data, dataIndex ) {
if(data[4]=="some value"){
$(row).addClass('red');
}
I wrote this function and it's working.but Now I have another
problem.I want to add button called "next action" to rows that
are fulfill below condition.
if(data[4]=="some value")
not only that,when I click this button It's must be show alert
box.How can I do this.please help me.
This discussion has been closed.
Answers
To show the button I would strongly suggest you use a renderer rather than
createdRow
.For the event handler, see this example.
Allan
thank you.
but my question is how to add button to selected rows.as example,
ID|Name|Age| |Address
01|Ann |23 | button |"12",west street.London
02|Mark |35 | button |"34",north street.UK
my table is like this. If Age==23 , then I click button and It must shows alert box like
alert("Take action B") .
please help me
I understood the question . As I said, use a renderer to create the button (you would use it as a function and the function would perform whatever logic check you need).
If you need to write an example for you, that would be covered by the support options.
Allan