guiqui / react-timeline-gantt

A react Timeline component with virtual rendering
MIT License
544 stars 132 forks source link

Feature request - Grouping items into one row or "multiple items per row" #36

Open masbaehr opened 5 years ago

masbaehr commented 5 years ago

It would be very useful to do something like this:

image

I'm checking the code and have noticed that each has a single probably it would be quite easy to add item property like "groupId" which allows to add multiple DataTask per row. I'll look into it and provide a PR when i have more time

kmocorro commented 4 years ago

Kindly share your PR on this. This is a good feature.

gianlucafiore commented 4 years ago

I am just needing this to show the side list with a whole series of apartments for rent and in the timeline mark the days booked. how can it be done?

masbaehr commented 4 years ago

Unfortunately it can't be done yet. I don't have a PR because it is waaay to hacky. Basically what i have done is using custom properties to the event like a group and then at a later point i am letting react-timeline-gantt render the whole thing, and manually pushing things around with dom operations when the groups are matched. E.g. if groupid=0 && row != 0 push to row 0 (first occurrency)

So in the end a code-change in react-timeline-gantt will have to be done in order to achieve this properly. E.g. as i already stated add a "group" parameter to each event. And when it matches - render it in the correct timeLine-main-data-row

Domino987 commented 4 years ago

I made a PR. Check it out : #48 @masbaehr , @gianlucafiore