grails 2.1にjquery datatableをインストールしようとしていますが、今まで運がありませんでした。JQuery、JQuery-ui、jquery-datatable プラグインをインストールしました。次のコードを main.gsp に追加しました。
<g:javascript library="jquery" plugin="jquery" />
<r:require module="application"/>
<jqui:resources />
そして、このコードは私の見解です:
<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>
しかし、レンダリングしようとすると、次の例外が発生しました。
TypeError: jQuery(...).dataTable is not a function
どうすればこれを解決できますか?