I have the Metronic v 8.1.5
wanted to try the basic Datatables in your help section .... cut/copied/pasted the html code into one of your templates. added the Js to the last of that page
All that I get to see is that the data is shown... but no sorting no icon etc.. are visible
when I open the full source code, I find that kt_datatable_zero_configuration is not part of any Js anywhere... is there any js that I need to add to it further to enable the formatting of Datatables?
using Metronic-Html
got its sorted... I was adding the KTUTil script in my content pages....
so I had to add it after all the JS are loaded then it works
Thanks
Great! All the best with your projects
If you need any further help please let me know.
Hi,
The basic datatables example has to use it's minimal JS code to initialize the datatable as shown here.
<!--begin::Vendors Javascript(used for this page only)-->
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
<!--end::Vendors Javascript-->
<script>
// On document ready
KTUtil.onDOMContentLoaded(function() {
$("#kt_datatable_zero_configuration").DataTable();
});
</script>
I did that same thing on one of the the demo1 pages
<table class="table table-row-bordered gy-5">
<thead>
<tr class="fw-semibold fs-6 text-muted">
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<script>
// On document ready
KTUtil.onDOMContentLoaded(function() {
$("#kt_datatable_zero_configuration").DataTable();
});
</script>
it says error
cannot find KtUtil