Ad
DataTable Is Not A Function, What's Wrong?
I'm using datatable on a laravel project. But table is not rendering. It is showing the error:
Uncaught TypeError: $(...).DataTable is not a function
at HTMLDocument.<anonymous> (dashboard:147)
at l (datatables.min.js:14)
at c (datatables.min.js:14)
I've included jQuery, js and css as following order
- jQuery
- datatable js
- datatable css
what else might cause the problem?
Ad
Answer
make sure to load the jquery.js before the preferred dataTable.js file.
<script type="text/javascript" src="~/Scripts/jquery.js"></script>
<script type="text/javascript" src="~/Scripts/data-table/jquery.dataTables.js"></script>
<script>$(document).ready(function () {
$.noConflict();
var table = $('# your selector').DataTable();
});</script>
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad