I am trying to install jquery datatable on grails 2.1 with no luck so far. I installed jquery, jquery-ui and jquery-datatable plugins. The following code has been added to main.gsp:
<g:javascript library="jquery" plugin="jquery" /> <r:require module="application"/> <jqui:resources />
and this code for 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 do this, I got the following exception:
TypeError: jQuery(...).dataTable is not a function
How can i solve this?
source share