Jquery (Datatables) features not fully initializing?

Jquery (Datatables) features not fully initializing?

DdudeDdude Posts: 3Questions: 1Answers: 0
edited June 2018 in Free community support

Hi everyone ,
my datables features are not showing even though i imported the css /js files used for folder build for the same page https://colorlib.com/polygon/gentelella/tables_dynamic.html

i think i need to add some missings css/scripts for datatables features that why it's not showing on the page
for more details click here
https://stackoverflow.com/questions/51003989/jquery-datatables-min-js-is-not-loading-correctly-via-webjar

here the full code used to import css /js files via Webjar


<link href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Datatables -->
<link href="/webjars/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
<link href="/webjars/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
<link href="/webjars/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
<link href="/webjars/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="/css/custom.min.css" rel="stylesheet">
















Answers

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    You can review the installation doc to learn the requirements to verify your page. If it looks like you are loading the correct CSS and JS includes then make sure you aren't getting errors in your browser's console. Errors may cause Datatables to not fully initialize.

    Can you post a link to your page or a test case showing the issue so we can help debug?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • DdudeDdude Posts: 3Questions: 1Answers: 0

    hi thank you for responding here a link i could not edit the post for some reason
    http://live.datatables.net/mozonoqe/1/edit

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    You don't have the JS and CSS includes in the correct order. The browser's console was showing this error:

    dataTables.fixedColumns.js:46 Uncaught ReferenceError: jQuery is not defined

    You need to load jQuery first. I moved that to the top then these messages were appearing:

    dataTables.buttons.js:42 Uncaught TypeError: Cannot read property 'ext' of undefined

    You need to load the base Datatables JS before the extensions. I moved that to the top now the page works.
    http://live.datatables.net/mozonoqe/2/edit

    Kevin

  • DdudeDdude Posts: 3Questions: 1Answers: 0

    thank for trying to help me i really appreciate it i put those paths in my html page http://live.datatables.net/mozonoqe/2/edit still not working
    i need only these features show entries (25 100 ) and search and pagination
    im working on web project (springboot) im importing the files via Webjars
    can you show me the rights github links (or webjars links like this for example <link href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">) to the right jquery and datatables used im using this template https://colorlib.com/polygon/gentelella/tables_dynamic.html

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    You are still loading the extensions before loading DataTables itself. Try using the download builder to get the files you need in the order you need.

    Allan

This discussion has been closed.