You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/30 13:30:08 UTC
[GitHub] [superset] stevetracvc commented on a change in pull request #19381: feat: add drag and drop column rearrangement for table viz
stevetracvc commented on a change in pull request #19381:
URL: https://github.com/apache/superset/pull/19381#discussion_r838545842
##########
File path: superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
##########
@@ -210,6 +218,33 @@ export default function DataTable<D extends object>({
const shouldRenderFooter = columns.some(x => !!x.Footer);
+ let columnBeingDragged = -1;
+
+ const onDragStart = (e: React.DragEvent) => {
+ const el = e.target as HTMLTableCellElement;
+ columnBeingDragged = allColumns.findIndex(
+ col => col.id === el.dataset.columnName,
+ );
+ e.dataTransfer.setData('text/plain', `${columnBeingDragged}`);
Review comment:
From what I remember, it's what allows the preview of the column header as you drag it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org