Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 中继器内按钮的索引_Jquery_Asp.net_Datatable_Repeater - Fatal编程技术网

Jquery 中继器内按钮的索引

Jquery 中继器内按钮的索引,jquery,asp.net,datatable,repeater,Jquery,Asp.net,Datatable,Repeater,我已经实现了一个中继器,每行都有按钮。单击按钮时,我需要找到使用jquery单击按钮所在行的索引。我还实现了jquerydatatable来显示数据。 我的表id是ADMIN 这是我的jquery $('#ADMIN TR:gt(0)').each(function (){}) 这将返回三行,例如tr.偶数、tr.奇数 另外,我的button类是Save,我能够使用以下jquery获得索引。。但我发现很难分离出这个索引并执行操作 $('.Save').closest('tr').each(f

我已经实现了一个中继器,每行都有按钮。单击按钮时,我需要找到使用jquery单击按钮所在行的索引。我还实现了jquerydatatable来显示数据。 我的表id是ADMIN

这是我的jquery

$('#ADMIN TR:gt(0)').each(function (){}) 
这将返回三行,例如tr.偶数、tr.奇数

另外,我的button类是Save,我能够使用以下jquery获得索引。。但我发现很难分离出这个索引并执行操作

$('.Save').closest('tr').each(function () {
    var a= $(this).index();

我试图访问索引,但没有用。

点击按钮即可抓取索引:

$('.Save').click(function () {
    var index = $(this).closest("tr").index();
});
@我是老板,总是乐于助人