Yes this is possible, but you'll need to add a little custom code to the fnDrawCallback function. What to do is use that callback to see if the settings (fnSettings()) indicate that DataTables is in a state where you want the DataTables controls to be hidden - if it is, then set them to be display:none, otherwise set display:block.
Is it possible to edit fnDrawCallback from outside .js file? I create dinamically tables within .php file. I searched a bit on documentation but did not find anything useful how to hide a table if it has 0 records. (hiding table will hide only the body, but not the table toolbar). A little simple code would be much appreciated.
Thanks in advance
EDIT: seems to have found docs (http://www.datatables.net/usage/callbacks). I will do some tries.
EDIT#2: with the help of a global var to know the state of initialization of table, the fnDrawCallback did the job. And it was really easy to use!
Replies
Yes this is possible, but you'll need to add a little custom code to the fnDrawCallback function. What to do is use that callback to see if the settings (fnSettings()) indicate that DataTables is in a state where you want the DataTables controls to be hidden - if it is, then set them to be display:none, otherwise set display:block.
Regards,
Allan
Thanks in advance
EDIT: seems to have found docs (http://www.datatables.net/usage/callbacks). I will do some tries.
EDIT#2: with the help of a global var to know the state of initialization of table, the fnDrawCallback did the job. And it was really easy to use!