move row down bug
hi @paulhodel, I try to use jexcel v3 move row function, then find a bug. move row to up is not problem ( table.moveRow(3, 0); ). However, when I move the row to down (table.moveRow(3, 0);). It should be move the first row to the forth position, but move to row 3. then will move wrong row and the spreadsheet y coordinate will wrong. could you solve it?
detail please refer below example.
https://jsfiddle.net/tsepakkwan/0xucfrah/5/

thanks your amazing project.
I saw the source code jexcel.js. Lines 2845 to 2856, If my understanding is correct, changing to the code below will solve this problem.
if (! ignoreDom) {
if (Array.prototype.indexOf.call(obj.tbody.children, obj.rows[d]) >= 0) {
if( o > d ){
//move up
obj.tbody.insertBefore(obj.rows[o], obj.rows[d]);
}else{
//move down
obj.tbody.insertBefore(obj.rows[o], obj.rows[d+1]);
}
} else {
obj.tbody.removeChild(obj.rows[o]);
}
}
// Place references in the correct position
if( o > d ){
//move up
obj.rows.splice(d, 0, obj.rows.splice(o, 1)[0]);
obj.records.splice(d, 0, obj.records.splice(o, 1)[0]);
obj.options.data.splice(d, 0, obj.options.data.splice(o, 1)[0]);
}else{
//move down
obj.rows.splice(d+1, 0, obj.rows.splice(o, 1)[0]);
obj.records.splice(d+1, 0, obj.records.splice(o, 1)[0]);
obj.options.data.splice(d+1, 0, obj.options.data.splice(o, 1)[0]);
}
It has been fixed.