にDatatables.net https://datatables.net/examples/advanced_init/length_menu.html の文書を1として、私はそれがだ、インラインで多次元配列を使用する方法thymeleaf 3
<script th:inline="javascript">
$(document).ready(function() {
$('#example').DataTable({
"lengthMenu": [[10, 25, 50, [[${rowTotal}]]], [10, 25, 50, "All"]]
});
});
</script>
しかし、レンダリングに、私のthmyeleafテンプレートにデータテーブルの実装にいくつかの設定を記述する必要があるのjavascriptそのようなエラーを私に与えてくれた。
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "10, 25, 50, -1], [10, 25, 50, 'All'" (template: "customer/customerlist" - line 237, col 21)
そしてthymeleafでこの文書を読んで、それは When inlining, if the expression between [[...]] is not a valid Standard Expression, it is output without modification, including the double-brackets.
https://github.com/thymeleaf/thymeleaf/issues/22を言われています。
この問題を解決するにはどうすればよいですか?
あなたは何をサーバ側からthymeleafテンプレートに渡していますか?私は普通のjavascriptしか見ません。それをjsファイルに入れてhtmlファイルに入れてください –
編集された質問 -1 - [[$ {rowTotal}]] –