Styling Datatables with JQueryUI using Require.js
Styling Datatables with JQueryUI using Require.js
Has anyone had success implementing JQueryUI when loading DataTables using Require.js? I just recently switched my application to load modules using requirejs and I lost my styling on the datatable. I was successfully styling the table before I switched to require by simply placing the JQueryUI css tag before the DataTables css tag in my html file. I haven't changed my css tags, but I have lost the styling. Any help or hints are much appreciated.
This question has an accepted answers - jump to answer
Answers
How are you loading the jQuery UI styling integration for DataTables (both the CSS and JS which are both required)? Can you show use the RequireJS configure you are using?
Allan
I load the css files in the html file in the following order:
My require config looks like this
I loaded the modules separately because that was the only way I could load the library without an error using require.js. I didn't include the datatables jqueryui files because I didn't think you have to if you are already loading the library. Is that correct? Thanks so much for your help.
You need to include the integration files as they have the required classes and behaviours to DataTables for jQuery UI styling.
If you load the CDN index page and click the "jQuery UI" button, it will show all the required files.
Note that the integration files and the extensions all refer to
datatables.net
as an AMD dependancy in the latest versions.Allan
Thank you so much. I added the required integration files and that fixed it.