Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public reorderRows(oldIndex: number, newIndex: number, length: number) {
this.data = Utils.reorderArray(this.data, oldIndex, newIndex, length);
}
private handleRowsReordered = (oldIndex: number, newIndex: number, length: number) => {
if (oldIndex === newIndex) {
return;
}
this.setState({ data: Utils.reorderArray(this.state.data, oldIndex, newIndex, length) });
};
}
private handleColumnsReordered = (oldIndex: number, newIndex: number, length: number) => {
if (oldIndex === newIndex) {
return;
}
const nextChildren = Utils.reorderArray(this.state.children, oldIndex, newIndex, length);
this.setState({ children: nextChildren });
};
public reorderColumns(oldIndex: number, newIndex: number, length: number) {
this.orderedColumnKeys = Utils.reorderArray(this.orderedColumnKeys, oldIndex, newIndex, length);
}