1

チェックボックスをクリックすると、チェックされているかどうかに関係なく、行のすべてのチェックボックスが表示されます(3つのチェックボックス)。

ここに画像の説明を入力してください チェックボックスをクリックするとupdate_order_status(this);

function update_order_status(e){
    var order_id = $(e).parents('tr').find('.order_id').html();
    var status_id = $(e).parents('tr').find('.status_id').val();

    $(e).parents('tr').find('input').each(function(i){
        //watch all input on the page, but not row
    });
}
4

2 に答える 2

2

最も近い方法を使用してください。チェックボックスメソッド内

function yourMethod(e){
  $(e).closest("tr").find(':checkbox').each(function(e2){
    // code
  });
}

最も近いメソッドは、ツリーの中で最も近いdom要素を選択し、それを見つけると停止するため、親trのみを選択します。

于 2012-10-28T12:27:16.923 に答える
0

チェックボックスの親を最初の行と呼び、代わりにこれを使用する必要があります。

$(':checkbox').click(function(e){
    $(this).parents("tr:first").find(':checkbox').each(function(e2){
         //Required logic here
    });
});
于 2012-10-28T12:23:03.317 に答える