Я смог выкопать еще немного и придумал что-то, что работает
$(function () {
$("#citationAreaTopTable tbody").sortable({
appendTo: "parent",
helper: getHelper, // "clone",
stop: function (event, ui) {
var attr = $(ui.item).attr('id');
var tableName = $(this).parent().attr("id");
$('#' + tableName + ' tr').each(function (event, ui) {
$(this).css('backgroundColor', 'white');
});
if (tableName == "citationAreaTopTable") {
var table = document.getElementById('citationAreaTopTable');
var pmidsText = '';
for (var i = 1; i < table.rows.length; i++) {
if (table.rows[i].cells.length) {
var id = (table.rows[i].id.substring(table.rows[i].id.indexOf("-") + 1));
pmidsText += id + ','
}
}
pmidsText = pmidsText.slice(0, -1);
$('#citationAreaTopList').html('<b>Selected PMIDS: </b>' + pmidsText);
}
},
update: function (event, ui) {
var tableName = $(this).parent().attr("id");
var id = '';
var index = 0;
if (tableName === '"citationAreaTopTable") ') {
//do something
}
$('#' + tableName + ' tr').each(function (e, u) {
$(this).css('backgroundColor', 'white');
if (u.id) {
if (u.id.slice(index).length > 0) {
id += u.id.slice(index) + ',';
}
}
});
Save_Sort(id);
}
}).disableSelection();
Это позволяет мне зациклить таблицу и вытащить идентификатор строки