FancyGrid icon indicating copy to clipboard operation
FancyGrid copied to clipboard

Rowdrag handle disappears when applying sort or filter

Open evbrew opened this issue 2 years ago • 5 comments

The column type of ‘rowdrag’ to support dragging vanishes if a sort or filter is applied.

Example from your website: https://fancygrid.com/dashboards/row-drag/

Note the drag handle is showing in first row. Now click a column header to sort. The drag handle vanishes. If you click column header twice more to remove sort the drag handle appears again.

Win Chrome V 105.0.5195.127

evbrew avatar Sep 29 '22 15:09 evbrew

Hi @evbrew It was speacially done. If grid is sorted or filtered then row drag is not available. It is not possible to reach stability for row dragging when grid is sorted or filtered.

MikeTatsky avatar Sep 29 '22 15:09 MikeTatsky

I can understand the stability issue - i was wondering if it could be allowed for another use case?

Disable row drag re-ordering and simply support the option to drag rows between tables to move them.

I want to have 2 tables that allow rows to be selected and dragged between them, no paging. I don't care about dragging the rows to specific order in the table, in fact when the rows are dragged/dropped into the 2nd table it would be fine to re-sort all rows with the current table sort.

But need to have the ability to sort/filter the records to make it easy for the user to find/select them for dragging.

evbrew avatar Oct 03 '22 16:10 evbrew

@evbrew Oh, I got. It is good case. Try to do something with it.

MikeTatsky avatar Oct 03 '22 16:10 MikeTatsky

@evbrew Add this after including library

<style>
.fancy-grid-state-sorted .fancy-grid-row-drag-el {
  display: block !important;
}

.fancy-grid-state-filtered .fancy-grid-row-drag-el {
  display: block !important;
}
</style>

MikeTatsky avatar Oct 03 '22 17:10 MikeTatsky

That seems to work fine, thank you!

evbrew avatar Oct 03 '22 18:10 evbrew