I'm trying to install jquery datatable on grails 2.1 with no luck until now. I installed JQuery, JQuery-ui and jquery-datatable plugins. added the following code to main.gsp:
<g:javascript library="jquery" plugin="jquery" />
<r:require module="application"/>
<jqui:resources />
and this code to my view:
<jqDT:resources />
<g:javascript>
$(document).ready(function() {
jQuery('#demo').dataTable({
sScrollY: '70%',
bProcessing: true,
bServerSide: true,
sAjaxSource: '${request.contextPath + '/person/dataTablesData'}' ,
sPaginationType: "full_numbers",
aLengthMenu: [[100, 500, 1000, 5000, -1], [100, 500, 1000, 5000, "All"]],
iDisplayLength: 500
});
});
</g:javascript>
but when I tried to render it I got the following exception:
TypeError: jQuery(...).dataTable is not a function
How can I solve this?