I think the term "plugin" is throwing you. This is not a Grails plugin - it is a jQuery plugin. Totally different. First of all make sure you have jQuery itself installed, active and working.
Your downloaded files will go in the following locations:
- .js files in
web-app/js
- .css files in
web-app/css
- image files in
web-app/images
(I'm pretty sure this is where they will work based on looking at the css file)
Then to include them in a gsp page:
In conf/ApplicationResources.groovy
modules = {
application {
resource url:'js/application.js'
resource url:'js/jquery.dataTables.min.js'
}
}
In GSP
<head>
<link rel="stylesheet" href="${resource(dir:'css', file: 'demo_table.css')}" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
<g:set var="entityName"
value="${message(code: 'User.label', default: 'User')}" />
<meta name="layout" content="main">
<g:set var="entityName"
value="${message(code: 'User.label', default: 'User')}" />
<title><g:message code="default.show.label" args="[entityName]" /></title>
<script>
$(document).ready(function() {
alert('I am working'); //remove once you see the alert
$('#table_id').dataTable();
});
</script>
</head>
....
(this should give you an alert when the page is loaded, just as a check to make sure jQuery is working. After you see the alert once you can remove that alert
line)
I included jQuery the way I use it; gets it from a CDN so I can keep up to date.
And then follow the rest of the example on the demo page you listed.