Jquery に問題があります。したがって、問題は、フォームを送信して結果のテーブルを取得するたびに発生することです。ページが更新され、Jquery ダイアログ ボックスに結果を読み込めません。これは私のコードです
<script>
$(function () {
$("#dialog").dialog({
autoOpen: false,
height: 600,
width: 1000,
show: "blind",
hide: ""
});
$("#opener").click(function () {
$("#dialog").dialog("open");
return true;
});
});
</script>
私のhtmlの場合:
<form id="searchtable" >
<label>Search by Username :</label><input type ="text" name="searchid" style="border: 1px solid black">
<input type ="submit" name ="search" id="opener">
<br>
<%-- search table --%>
Results:
<div id="dialog" title="Search Result">
<table border ="1" id="normal">
<tbody>
<tr>
<th>ID</th>
<th>Username</th>
</tr>
</tbody>
<g:each in = "${example}">
<tr>
<td>${it.ID}</td>
<td>${it.username}</td>
</tr>
</g:each>
</table>
</div>
<%--List Table--%>
<table border ="1" id="normal">
<tbody>
<tr>
<th>ID</th>
<th>Username</th>
</tr>
</tbody>
<g:each in = "${result}">
<tr>
<td>${it.ID}</td>
<td>${it.username}</td>
</tr>
</g:each>
</table>
</form>
したがって、値を送信した後、コントローラーで値を処理し、それを html に戻して表示する必要があります。しかし、それは更新されるだけで、ロードできません。それで、誰が何をすべきか知っていますか?フォームの送信後にロードする必要があるだけです->更新->ダイアログボックスが結果とともに表示されます。どうもありがとうございました