Page 1 of 1

[ANGULAR] Listener for task vertical order swap

Posted: Thu Feb 02, 2023 10:39 pm
by johanbrodin

Hi,

We have a use case with a parent task having children tasks. The user shall be able to rearange the order of the children but it shall not be possible to drag them outside the parent.

So we need a listener that returns either true or false if the drop is allowed. Below is an example but we cannot find the event name in the documentation.

      	//listener - beforeTaskDropFinalize is only trigging if start data change
     	this.gantt.on('WHAT SHOULD WE ADD', (event: any) => {
        	const { context } = event;
                console.log(context);
      	});

Regards
Johan


Re: [ANGULAR] Listener for task vertical order swap

Posted: Thu Feb 02, 2023 10:52 pm
by mats

It's this event: https://bryntum.com/products/gantt/docs/api/Grid/feature/RowReorder#event-gridRowBeforeDropFinalize and it's fired on the feature actually.

this.gantt.features.rowReorder.on('gridRowBeforeDropFinalize', (event: any) => {
        	const { context } = event;
                console.log(context);
      	});

Re: [ANGULAR] Listener for task vertical order swap

Posted: Fri Feb 03, 2023 3:05 pm
by johanbrodin

Thank you Mats! It is working as expected and you can close the ticket.