Adding DataTables to a site that already had jQuery and Bootstrap
Adding DataTables to a site that already had jQuery and Bootstrap
I created a sample page and included the datatables.js file as directed. I also tried including or not including jQuery. Worked the same either way. Yet I couldn't find in datatables.js that it somehow magically imported jQuery. Is the entire jQuery library contained in datatables.js?
The reason I wonder is that i tried to add datatables to a project that already uses jQuery and Bootstrap. That broke a plug-in for a listbox with checkboxes next to the list items. So I'm just trying to get a handle on things. I used the datatables builder to include a whole ton of extensions, such as ability to export to Excel. But those won't work unless specifically included, right?
Answers
No.
The simplest approach here would be to provide your HTML code, showing how you are incorporating the necessary js references.
What is that? DataTables requires jQuery.
As I said, DataTables seems to work whether or not jQuery is included.
Using the downlaod builder you can include jQuery. Maybe the jQuery version included is not compatible with your other plugins or if you are loading it twice you likely will have problems. Maybe try the download builder again and don't include jQuery but include the Bootstrap styling files, Datatables and the extensions you want.
I'm not sure if the third party (JSZip, for example) files needed for the export buttons are included but you can add them manually if needed.
Kevin
Exactly as Kevin says. If you have selected the jQuery option in the download builder, then yes, it will include jQuery. The way to check what is being included is to open the
datatables.js
file in a text editor. At the top it will say what is being included.Allan