Summary: I have a table where rows are added for each btn click. I am using jquery-ui sortable() function to move/sort the rows.
Let say i have this:
<tbody>
<tr><td>A</td></tr>
<tr><td>B</td></tr>
<tr><td>C</td></tr>
<tr><td>D</td></tr>
<tr><td>E</td></tr>
<tr><td>F</td></tr>
</tbody>
Issue: I can move the rows using sortable() function. But i am not able to update the elements in the rows. i am using this
$('.report-configuration .configuration-table tbody').sortable({
'change': function(event, ui){
arr=['a','b','c','d','e','f'];
console.log(ui);
var tmp = arr.splice(ui.originalPostion);//i am missing logic here
arr.splice(ui.postion, tmp);
console.log(arr);
}});
I am looking for the logic to update the positions in the array.