table icon indicating copy to clipboard operation
table copied to clipboard

feat: re-order rows with drag and drop and / or context menu

Open Aarbel opened this issue 1 year ago • 4 comments

Hi Editor js team,

Thanks again for your amazing work. Do you know a way to reorder tables rows with drag and drop, or with context menu "move up / down - left / right ?

image image

Must have solution

image

Nice to have solution

Doing it with drag and drop, thanks to https://github.com/kommitters/editorjs-drag-drop/issues/144

Thanks a lot !

Aarbel avatar Apr 23 '24 13:04 Aarbel

Hi, following back about this last issue created.

Is there a way to implement drag and drop of rows / columns to re-adjust their order ?

Thanks a lot

Aarbel avatar May 02 '24 11:05 Aarbel

@1GeekaN2 @neSpecc do you still maintain this lib ? do you need help to maintain it ?

Aarbel avatar May 02 '24 11:05 Aarbel

@1GeekaN2 @neSpecc do you still maintain this lib ? do you need help to maintain it ?

Yes, but I'm currently focused on Editor core updating.

What about drag-and-drop or moving through the context menu? I believe it can be implemented. What is your priority?

neSpecc avatar May 02 '24 13:05 neSpecc

@1GeekaN2 @neSpecc do you still maintain this lib ? do you need help to maintain it ?

Yes, but I'm currently focused on Editor core updating.

What about drag-and-drop or moving through the context menu? I believe it can be implemented. What is your priority?

Thanks a lot @neSpecc for the quick answer. Priority would be thru the context menu (move row up, move row down, move column left, move column right), that's much more straightforward to implement.

image

Do you need help to implement it ? That should just be a very simple array switching in the state of the table

{
  "type" : "table",
  "data" : {
    "withHeadings": true,
    "content" : [ 
        [ "Kine", "Pigs", "Chicken" ], 
        [ "1 pcs", "3 pcs", "12 pcs" ], 
        [ "100$", "200$", "150$" ] ] // moving this row up 
  }
}

=>

{
  "type" : "table",
  "data" : {
    "withHeadings": true,
    "content" : [ 
        [ "Kine", "Pigs", "Chicken" ], 
        [ "100$", "200$", "150$" ] ],
        [ "1 pcs", "3 pcs", "12 pcs" ]
  }
}

Aarbel avatar May 02 '24 14:05 Aarbel