<script>
var fixHelperModified = function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index) {
AJS.$(this).width($originals.eq(index).width())
});
return $helper;
},
updateIndex = function(e, ui) {
AJS.$('td.cf_ordernr', ui.item.parent()).each(function (i) {
AJS.$(this).html(i + 1);
console.log('ui = ');
console.log(ui);
});
AJS.$(".cf_f_table tbody").find('tr').each(function(){
console.log(AJS.$(this));
var entryId = AJS.$(this).attr('confi-data-id');
console.log('entryId = ' + entryId);
});
};
AJS.$(".cf_f_table tbody").sortable({
helper: fixHelperModified,
stop: updateIndex
}).disableSelection();
</script> |