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
{{ message }}
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
Is there any examples that show how to make a single column grid sortable and draggable? (unmanaged dragging)
The onRowDragMove event doesn't fire properly.
Each row is an object with only two key-value pairs: name and path. This is what I've tried
function onRowDrag(e) {
console.log('row drag()')
let movingNode = e.node;
let overNode = e.overNode;
let rowStore = e.api.getRenderedNodes();
console.dir(rowStore);
let rowNeedsToMove = movingNode !== overNode;
if (rowNeedsToMove) {
// the list of rows we have is data, not row nodes, so extract the data
let movingData = movingNode.data;
let overData = overNode.data;
let fromIndex = rowStore.indexOf(movingData);
let toIndex = rowStore.indexOf(overData);
let newStore = rowStore.slice();
moveInArray(newStore, fromIndex, toIndex);
rowStore = newStore;
e.api.setRowData(newStore);
e.api.clearFocusedCell();
}
function moveInArray(arr, fromIndex, toIndex) {
var element = arr[fromIndex];
arr.splice(fromIndex, 1);
arr.splice(toIndex, 0, element);
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there any examples that show how to make a single column grid sortable and draggable? (unmanaged dragging)
The onRowDragMove event doesn't fire properly.
Each row is an object with only two key-value pairs: name and path. This is what I've tried
The text was updated successfully, but these errors were encountered: