init event does not fire without ajax
init event does not fire without ajax
andreinariera96
Posts: 2Questions: 2Answers: 0
Hello, I am trying to detect when datatable is loaded in the table, to know at the moment that the pager is added. If the pager has only one page, I hide it with jquery, if not, I leave it.
But, the init event never fires. I imagine it is because the table is created with PHP and not ajax. Is there a way to hide the pager if there is only one page? Or that init event fires without ajax?
This discussion has been closed.
Answers
You didn't post your code so I'm guessing its the order you are initializing Datatables and creating the
init
event. You will want to create the event handler as shown in theinit
example code so it executes before Datatables initializes.Kevin