Can I make rectangle from mouse to add taskbar data in gantt

@ramil Can I draw events in the timeline?
explanation:- so I want to add a feature that if the user draws a rectangle from date 10 to date 14 then it will give the option to add a taskbar layer in Gantt dhtlmx data.

Hello,
You can use the click_drag extension to draw rectangles and add tasks:
https://docs.dhtmlx.com/gantt/desktop__advanced_dnd.html
https://docs.dhtmlx.com/gantt/api__gantt_click_drag_config.html

Here are examples:
https://docs.dhtmlx.com/gantt/samples/02_extensions/24_click_drag.html

https://docs.dhtmlx.com/gantt/samples/02_extensions/23_click_drag_splittask.html

so when I am drawing a rectangle it open pop-up for filling data instead of that pop up I want to open my drawer and from that drawer want to select data to show in Gantt is there any possibility to do this if yes please help me.
@ramil

Hello,
In the samples I shared, you can see that the tasks are added by using the createTask method in the onDragEnd function:


So, you can replace that method with your code.

https://docs.dhtmlx.com/gantt/samples/02_extensions/23_click_drag_splittask.html
can i get snippet of this task please.
@ramil

Hello,
If you want to check the source code of the sample, you can press the Control+U hotkey:


view-source:Create split tasks by Drag and Drop

And you can also type the sample name on the main samples page, then you will be able to see the source code in the sample preview frame:
https://docs.dhtmlx.com/gantt/samples/

https://files.dhtmlx.com/30d/33f31b2ad675a3b20a2f0e1034ebaa3d/vokoscreen-2024-06-27_11-41-36.mp4