init event does not fire without ajax

init event does not fire without ajax

andreinariera96andreinariera96 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?

Answers

  • kthorngrenkthorngren Posts: 21,179Questions: 26Answers: 4,923

    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 the init example code so it executes before Datatables initializes.

    Kevin

This discussion has been closed.