React-calendar-timeline: Drop item from outside calendar at any point of time

Created on 13 Jan 2020  路  5Comments  路  Source: namespace-ee/react-calendar-timeline

The problem
I have tested beta version on rowRenderer and I cannot drop item from the outside of the calendar at any point of time

Solution
It would be nice if the library provides some functionality to drop items from the outside of the calendar at any point of time.

rowRenderer

All 5 comments

I came up with the solution to do this and I want some feedback because I am not sure that is a decent way to do it so.

The problem is I want to drop the items from outside of the calendar.

  1. I get the clientOffset, x coordinate from drop monitor, which is a function from react-dnd.
  2. I have used timeFor(e) the function to calculate the dropping point of time that has been placed in HelpersContext, to use in rowRenderer, which contains drop area.
  3. So drop function from react-dnd could get the dropping point of time, now I could calculate start_time and end_time to update item in gantt.

Thank you.

@napatwongchr yep this sounds good! The community would appreciate it if you could provide a codesandbox for your solution.

@napatwongchr Can't we implement this with a custom renders and react dnd?

@janakact Yes it could, you could check it out on the example on 0.27.0-beta release. But from the example you could only drop on specific slots that you have defined. You have to modify it to make it drop on anywhere on timeline. So, that I came up with solution above.

@napatwongchr Bro, Can you please share a working example?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sabina4 picture sabina4  路  4Comments

kevinmeyvaert picture kevinmeyvaert  路  4Comments

forki picture forki  路  5Comments

danielcruser picture danielcruser  路  3Comments

stahlmanDesign picture stahlmanDesign  路  4Comments