2
votes

All of the row drag examples in the ag-grid documentation prevent the row from being dragged out of the grid area. https://www.ag-grid.com/javascript-grid-row-dragging/

I would to accomplish this as well. However, in my own projects the row is able to be dragged anywhere on the page.

Is there a setting, etc. I'm missing that enables this constraint?

1
The examples in the page are all within iframes, it's the iframe that is stopping the element from being dragged out - Jarod Moser
Wow, you're right. I'm not sure how I missed that. Thank you! - TheLostBrain
Is there a way to achieve this without putting the table in an iframe? - Guido Visser

1 Answers

0
votes

Try these Settings to disable Dragging

var columnDefs = [
  {
    field: 'athlete',
    suppressMovable: true,
    width: 150,
    cellClass: 'suppress-movable-col',
  },
  { field: 'age', lockPosition: true, cellClass: 'locked-col' },
  { field: 'country', width: 150 },
  { field: 'year' },
];