//获取行号 function getRowIndex(target) { //获取匹配的第一个祖元素 var tr = $(target).closest('tr.datagrid-row'); return parseInt(tr.attr('datagrid-row-index')); }