ghiscoding/Angular-Slickgrid

Dynamically start/stop row move feature

SMarongui opened this issue · 1 comments

Clear and concise description of the problem

As of today Row Move feature is enable in gridOption with (for example)
enableRowMoveManager: true,
rowMoveManager: {
singleRowMove: true,
disableRowSelection: true,
cancelEditOnDrag: true,
hideRowMoveShadow: false,
width: 30,
onBeforeMoveRows: this.onBeforeMoveRow.bind(this),
onMoveRows: this.onMoveRows.bind(this),
columnIndexPosition: 0,

And Burger buttons appear at the beginning of each line to drag lines up down

Suggested solution

Would it be possible to add the capability to dynamically switch off/on the feature once the grid is created and live.
To be able for example to

  • "enter an edit mode", showing burger buttons and enabling the drops
  • "leave the edit mode", hidding the buttons and keep a static grid

Alternative

No response

Additional context

No response

Validations

You probably can't disable/re-enable the Row Move because it needs to be created before the grid gets created. However, you can probably hide the feature, with the override

// you can also override the usability of the rows, for example make every 2nd row the only moveable rows,
// usabilityOverride: (row, dataContext, grid) => dataContext.id % 2 === 1
},

and you could also maybe hide the column

angularGrid.gridService.hideColumnById('_move');

apart from that, I won't change anything, that's the only option you have and that should be enough

Also please think about posting questions on Stack Overflow which is a better platform