Twitterブートストラップモーダルを使用したポップアップウィンドウがあります。ポップアップ表示前にコントローラーアクションを呼び出し、コントローラーアクションから変数の値をポップアップに表示したい。ajax はコントローラー アクションを呼び出していません。それを行う他の方法はありますか?
私のgsp:
<g:javascript>
$(document).ready(function() {
$('#myModal').on('show', function () {
$.ajax({
type: "GET",
url: "${createLink(controller: 'mGMatrices', action: 'popup')}"
}).done(function(data) {
$('#modal-body').html(data);
});
});//end on()
});//end ready()
</g:javascript>
<g:textField name="inputField" />
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>some content</p>
<input type="text" name="bookId" id="bookId" value=""/>
</div>
</div>