Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row reordering with DragDrop for TurboTable #504

Closed
luking4 opened this issue Jun 21, 2016 · 38 comments
Closed

Row reordering with DragDrop for TurboTable #504

luking4 opened this issue Jun 21, 2016 · 38 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@luking4
Copy link

luking4 commented Jun 21, 2016

Hi,
One of the important functionality of datatable could be dragging and dropping rows within table.

Even though draggable and dropable component is available and example shows how to drag and drop from outside into datatable as below,

http://www.primefaces.org/primeng/#/dragdrop

There is no example or feature telling about dragging and reordering row within datatable like below example.

http://blog.primefaces.org/?p=3026
http://www.guriddo.net/demo/guriddojs/integrations/drag_drop_rows/index.html

Is it possible? if so, could you please provide code for it?

@luking4 luking4 changed the title Datatable drag row feature Datatable drag row ( Row reorder ) feature same as PrimeFaces data table Jun 27, 2016
@reach4thelasers
Copy link

I would love to see this feature also

@zibeeze
Copy link

zibeeze commented Aug 6, 2016

+1

@skdhir
Copy link

skdhir commented Oct 21, 2016

+1

@rklempert
Copy link

We need this functionality as well. We are currently combining ng2-dnd with p-datatable. However, it doesn't work as nice because as you drag [value] keeps getting updated nonstop and all the rows flicker back and forth. The only way to control it is to specify [rowTrackBy] function to be () => {}. This was present in 1.1.1, but was removed in 1.1.3.

@ashishjain16
Copy link

+1

2 similar comments
@cyberrranger
Copy link

+1

@phoenixchinar
Copy link

+1

@taivu
Copy link

taivu commented May 11, 2017

would beer someone to add this.

@cagataycivici cagataycivici changed the title Datatable drag row ( Row reorder ) feature same as PrimeFaces data table Row reordering with DragDrop May 27, 2017
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label May 27, 2017
@gabrielalack
Copy link

+1

1 similar comment
@vatsalpande
Copy link

+1

@a-kolybelnikov
Copy link

+1
any update on this request? maybe an estimated release date? need it badly.

@mgudesblatart
Copy link

+1

@guntram
Copy link

guntram commented Jul 19, 2017

@taivu how much beer?? 🍻

@domantasjurkus
Copy link

+1

@GuzzoLM
Copy link
Contributor

GuzzoLM commented Aug 10, 2017

My issue was similar, I had to drag a row from table A and drop into a row of table B.
Managed to do this with ng-template, but it would be really nice to see an out-of-the-box funcionality doing this.

@jrotondo-madaket
Copy link

Upvoted. Need this.

@israelkozitz
Copy link

+1

1 similar comment
@arwindgao
Copy link

+1

@akolybelnikov
Copy link

I needed user to be able to reorder rows in the datatable by dragging. I have implemented it with ng2-dragula directive:
https://alligator.io/angular/drag-drop-ng2-dragula/
It has worked out-of-the-box and even the transition graphics are looking fine. Perhaps this can help somone out.

@arwindgao
Copy link

arwindgao commented Sep 21, 2017

@akolybelnikov hi, ur post is really helpful for pure html tag situation, but i want to know if i can integrate dragula with primeng's data-table scenario, just like this post(#2209), would you like to help on this? thanks in advance.

@akolybelnikov
Copy link

@arwindgao check this plunkr out:
https://embed.plnkr.co/Mivcv5/
I'm applying the dragular directive on the primeng pDatatable element and the rows can be reordered by drag and drop in the same table. Hope this helps.

@arwindgao
Copy link

It's works!!! Thanks!!! @akolybelnikov

@lasimone
Copy link

+1

@jrotondo-madaket
Copy link

Thanks so much @akolybelnikov! Your Plunker is genius!

@jrotondo-madaket
Copy link

One quick note about @akolybelnikov's plunker, after I implemented the solution, my app failed it's aot build. The "bag" declared in the primeNG table doesn't have a value within the typescript file, and Angular didn't like that.

For me, the solution was just to not pass the bag into primeDragula. It doesn't seem to need it:
<p-dataTable [value]="rows" [tableStyle]="{ 'table-layout': 'auto' }" primeDragula [dragulaModel]="rows" [dragulaOptions]="{ childContainerSelector: 'tbody', initAfterView: true }" #datatable>

I hope that helps someone.

@jdashcode
Copy link

+1

@tony-scialo
Copy link

+1

5 similar comments
@healydwya
Copy link

+1

@andregodasi
Copy link

+1

@tburger
Copy link

tburger commented Dec 12, 2017

+1

@rich4756
Copy link

rich4756 commented Jan 4, 2018

+1

@gustavodemorais
Copy link

+1

@cagataycivici cagataycivici changed the title Row reordering with DragDrop Row reordering with DragDrop for TurboTable Jan 19, 2018
@cagataycivici cagataycivici added this to the 5.2.0-RC2 milestone Jan 19, 2018
@cagataycivici cagataycivici self-assigned this Jan 19, 2018
@cagataycivici
Copy link
Member

We'll try this for new TurboTable targeting 5.2.0-RC2

@cagataycivici cagataycivici modified the milestones: 5.2.0-RC2, 5.2.0-RC3 Jan 22, 2018
@cagataycivici
Copy link
Member

Moved to RC3 as we need to release RC2 asap.

@cagataycivici cagataycivici modified the milestones: 5.2.0-RC3, 5.3 Jan 29, 2018
@cagataycivici cagataycivici added this to the 5.2.1 milestone Mar 2, 2018
@cagataycivici
Copy link
Member

Checkmate!

reorder

@jdashcode
Copy link

Niiiiiiice

@alexwiese
Copy link
Contributor

For those who are interested you can make the entire row draggable (not just the handle) by applying the handle directive to the actual cell.

      <td *ngFor="let col of columns" pReorderableRowHandle>
        {{rowData[col.field]}}
      </td>

@shorstki
Copy link

shorstki commented Apr 10, 2019

Any hook for handling reorder like onDragEnd? Can't find anything in the docs

Also is it possible to pass item property as pReordableRow? Tried multiple combinations but with no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests