Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REACT] Allow using react components in task/event renderers #3972

Closed
bmblb opened this issue Dec 31, 2021 · 7 comments
Closed

[REACT] Allow using react components in task/event renderers #3972

bmblb opened this issue Dec 31, 2021 · 7 comments
Assignees
Labels
feature request forum Issues from forum high-priority Urgent to have fixed in progress

Comments

@bmblb
Copy link

bmblb commented Dec 31, 2021

Forum post

Is there a way to use custom react node in task render function, for example:

const taskRenderer = ({ cardConfig, taskRecord }: any) => {
    cardConfig.children.body.children.details = {
      html: <CardBody />
    };
};

This example renders [object Object], I also tried tag property and passing string instead of object, but with no luck.
I need a way to dynamically load different cards.
This is just a simple example, but I would also pass the props to my CardBody component.

Thanks

@bmblb bmblb added feature request forum Issues from forum labels Dec 31, 2021
@bmblb
Copy link
Author

bmblb commented Dec 31, 2021

related issue #3452

@jsakalos jsakalos changed the title [REACT] Allow using react components in task renderers [REACT] Allow using react components in task/event renderers Feb 7, 2022
@Aarbel
Copy link

Aarbel commented Feb 10, 2022

@bmblb do you have any advancement updates on this ?

@isglass
Copy link
Contributor

isglass commented Feb 10, 2022

Hi @Aarbel,

I am afraid there isn't anything new to report on this issue yet. But you should be able to listen to the renderTask och TaskBoard, which is triggered when a tasks element is available. In the listener you could portal in your React component. You would have to manage cleanup of it too in a removeTaskElement listener.

https://bryntum.com/docs/taskboard/api/TaskBoard/view/mixin/TaskBoardDomEvents#event-renderTask

@jeffreybos
Copy link

Is there also an option to show React Components in Events at the Scheduler Pro?

@jsakalos
Copy link

Unfortunately, we don't yet support React components as task renderers. However, a user posted an approach that works for him in tooltips. Perhaps it is worth to try; it may work for tasks too. Here is the link: https://www.bryntum.com/forum/viewtopic.php?f=44&t=13554

@marciogurka
Copy link

+1 user post asking for this feature.

@matsbryntse
Copy link
Member

Being implemented in #4600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request forum Issues from forum high-priority Urgent to have fixed in progress
Projects
None yet
Development

No branches or pull requests

7 participants