Hello,
i need to know if it's possible create mRender with function javascript inside a JSON object server-side. I need because i initialize DataTable from json server-side and not in client-side
No its not - at least not with only DataTables. You need to make the Ajax call to the server to get the column definitions before initialising DataTables. Columns cannot currently be dynamically added and deleted from a DataTables. A shortcoming that I will be working on soon.
That's not valid JSON. You've got a function in there. That is why this is not possible with DataTables directly - aoColumns is not always valid JSON. As soon as you use a function it isn't.
You need to load the script dynamically, which is done outside of DataTables.
Replies
Allan
for example
JSON object from server-side:
[code]
{"aoColumns":[{"mData":"aaa","sName":"aaa","bSortable":true,"bVisible":true,"mRender":function(){ JAVASCRIPT LOGIC}}]}
[/code]
this is my goal...i need to do this in my server-side but don't work
You need to load the script dynamically, which is done outside of DataTables.
Allan