Help with jquery sorable
Help with jquery sorable
Hi
I have the following code to manually sort a table using jquery. It is working OK. I just want to add some code that will write the "revised" order to a variable "DMCORDER" so that I can commit it to the database after the full form is completed.
Would anyone be kind enough to show me how to do this please?
Many thanks in advance.
Regards
Mark
code =
var fixHelperModified = function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(idxPOS) {
$(this).width($originals.eq(idxPOS).width())
});
return $helper;
},
updateidxPOS = function(e, ui) {
$('td.idxPOS', ui.item.parent()).each(function (i) {
$(this).html(i + 1);
});
};
$("#dmclist tbody").sortable({
helper: fixHelperModified,
stop: updateidxPOS,
}).disableSelection();