You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce. Add 12 items to the grid. Select items 8,9,10, Move to above position 7. The list will in grow by one item.
This is a problem in onMoveRows and is due to lexical instead of numeric sorting. In the example above row 10 will be sorted before 8 & 9 which is a problem for the splices below. The code below corrects the problem. It also fixes a misordering problem when moving multiple rows
...
var insertBefore = args.insertBefore;
left = data.slice(0, insertBefore);
right = data.slice(insertBefore, data.length);
// Put in table order - the selection doesn't guarantee this
rows.sort(function(a,b){return a-b});
for (var i = 0; i < rows.length; i++) {
extractedRows.push(data[rows[i]]);
}
// Need to sort reverse numerically or else the splices below fail badly
rows.reverse();
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
if (row < insertBefore) {
left.splice(row, 1);
...
The text was updated successfully, but these errors were encountered:
To reproduce. Add 12 items to the grid. Select items 8,9,10, Move to above position 7. The list will in grow by one item.
This is a problem in onMoveRows and is due to lexical instead of numeric sorting. In the example above row 10 will be sorted before 8 & 9 which is a problem for the splices below. The code below corrects the problem. It also fixes a misordering problem when moving multiple rows
The text was updated successfully, but these errors were encountered: