Using render with consition on global variables ?
Using render with consition on global variables ?

Hi.
I read the documentation forward and backward but still couldn' figure it out...
all im trying to do is a condition inside the render function based on a global boolean
var boolean = false;
"render": function ( data, type, full, meta ) {
if (boolean){return something
}else{
return something else
}
}
but this is completely ignored.
I'm just trying to wrap my head arround this before trying things out. Any Explanation is very welcome :-)
This discussion has been closed.
Answers
There is nothing special about using global variables. It just needs to be declared before you initialize Datatables and available in the scope of the function Datatables is defined in. Here is an example:
http://live.datatables.net/yetekubo/2/edit
Kevin
Just noticed something. Your variable is
boolean
is a reserved word in Javascript. Maybe thats why its not working.Kevin
....
Just working fine. the boolean got returned as a string ... omg