1

Jqueryモーダルダイアログボックスを使用して値をコントローラーに渡すことにより、UPDATE関数を実行しようとしています。しかし、値を HTML テーブル ボックスに表示しています。値をテーブル行からモーダル ボックスに渡す方法はありますか? 行をクリックすると値がモーダルに表示されるようにしたいです。また、jquery ダイアログ ボックスをテーブル行にリンクする方法もわかりません。

これがテーブルです

ここに画像の説明を入力

これらはそのためのコードです

<form id="searchtable" >
               <%--List Table--%>
               <table border = 1 cellpadding = 2  cellspacing = 2 id="normal">
              <tr>
                 <th width=9.7%>ID</th>
                 <th width=24%>Username</th>     
                 <th width=13%>Account ID</th>
                 <th width=29%>Email</th>
                 <th width=10%>User ID</th>
                 <th width=12%>Device ID</th>         
              </tr>
         </table>

              <div style="height: 250px; overflow: scroll; width: 100%;">
              <table id="normal">
              <g:each in = "${result}">
              <tr>
              <td width=10%>${it.ID}</td>
              <td width=25%>${it.Username}</td>
              <td width=13.5%>${it.account_id}</td>
              <td width=30.5%>${it.email}</td>
              <td width=10.5%>${it.user_id}</td>
              <td width=13%>${it.device_id }</td>
              </tr>
              </g:each>


              </table>
         </div>        
    </form>

これは、どのように表示されるかを示すダイアログ ボックスの例です。

ここに画像の説明を入力

どうもありがとうございました。必要に応じて、コードを提供できます。

4

1 に答える 1

1

.btn クラスを tr に使用し、ユーザー名の値を

<span class="username">${it.username}</span>

あなたのjqueryはすべきです

$(document).ready(function() {
  $(".btn tr").live("click", function{
    var name = $(this).find(".username").text();
    ...put your code here that will update your table...
  });
});

tr をクリックすると、クラス「username」の子が検索され、データが取得されます。

于 2013-01-29T02:30:05.593 に答える