how to make multiple data tables pass id
how to make multiple data tables pass id
how do I pass the id of each data table to java script
PHP ( advanced-table-<? $dadosforuns['id']; ?>
)
<table id="advanced-table-<? $dadosforuns['id']; ?>" class="table dt-responsive table-striped table-bordered nowrap" width="100%">
Java script ( #advanced-table- ** how to send php id ** )
var advance = $('#advanced-table').DataTable(
$.extend( advance, searchOptions )
);
This question has an accepted answers - jump to answer
Answers
If you are generating your Javascript using PHP, then pass it in just as you are doing for your HTML. If you aren't generating the Javascript with PHP, then could you set up a Javascript variable that will contain an array of the ids. Or if your table have all the same init options, just use a class selector:
Allan
sorted out code:
thanks Alan