Loading content into the datable on form submit
Loading content into the datable on form submit
Hey guys,
I would like to put my datatable "to work" only after I fill in some edit boxes (used as filters), not automatically when accessing my page. This is due to the large amount of data in my table which I don't want to load on initalisation as it's taking ages.
In my case I would like to add a date picker in order to display data of the selected day.
I believe it requires a form, an edit box and a submit button, plus changing the $(document).ready(function() into something else.
However, since I might be wrong, I would like to ask you if there is an example for this, on how to do it the "right" way?
Thank you.
This question has an accepted answers - jump to answer
Answers
There isn't an example for that, but basically you wouldn't call the
$().DataTable()
method until you are ready to initialise the DataTable.Allan
It might be basic, but can you please tell me how to call it, if I would like to call it, after clicking the submit button?
Here is the example and my solution, but there might be a more elegant one:
```
<?
<?php > ... $(document).ready(function() { ... }); ... <? } ?> ``` ?>if ($_POST["date"] != '') {
Thank you!
Thank you!