Page 1 of 1

[REACT] Add JSX Element in Resource Header.

Posted: Tue Apr 04, 2023 12:58 pm
by coderboy@12

Hi All,

Just quick question Can we add our Custom element or control to Resource Header Like our organization have it's custom controls and I want to use it in Resource header without using JS(Direct use Tags?).

And we have then How can I apply?

Thanks :)


Re: [REACT] Add JSX Element in Resource Header.

Posted: Tue Apr 04, 2023 2:42 pm
by alex.l

Hi, currently it is not supported. We have a ticket to add that https://github.com/bryntum/support/issues/5808


Re: [REACT] Add JSX Element in Resource Header.

Posted: Tue May 30, 2023 12:41 pm
by coderboy@12

Hello, Can someone tell me if this feature is available or not?


Re: [REACT] Add JSX Element in Resource Header.

Posted: Tue May 30, 2023 12:47 pm
by alex.l

Hi, no it is still in progress. I asked developer how long it can take, and he said few more weeks not earlier.
You can subscribe on ticket updates to be notified when status changed.
Thank you for your patience.


Re: [REACT] Add JSX Element in Resource Header.

Posted: Sun Jul 23, 2023 5:00 pm
by odiyaerlichster

Hi, any updates on this? According to the docs it does appear that headerRenderer in the columns config can return JSX, but it doesn't seem to work.


Re: [REACT] Add JSX Element in Resource Header.

Posted: Sun Jul 23, 2023 8:27 pm
by mats

We'll try to get this one over the line shortly! Please follow the GitHub ticket for updates.


Re: [REACT] Add JSX Element in Resource Header.

Posted: Mon Jul 24, 2023 5:53 pm
by odiyaerlichster

Thanks!


Re: [REACT] Add JSX Element in Resource Header.

Posted: Fri Jul 28, 2023 5:42 pm
by ort
mats wrote: Sun Jul 23, 2023 8:27 pm

We'll try to get this one over the line shortly! Please follow the GitHub ticket for updates.

Hi mats,

to get more pressure, I will also stick to this request! :)

Why do we need JSX support in dayHeaderRenderer (ans also in eventRenderer) =>
Maybe as you allready know we use the Calendar as timetracking tool, where you can also see your Outlook365 entries (if you granted read access).
We only use the Week overview and add in the dayHeader a visual ReactComponent to see how much time for this day is allready tracked calculated to the resource workday. (5 workdays with 8 hours
per day)
Image

We use this component on several places in the app, so it makes sense to use it also in the calendar.
And because it's a summary for the day, it makes sense to place it in the header for each day!

Currently I do that by dom-mutation, so React does not have control over statechanges and rerendering. We all know, we should not use that kind of concept. And tbh it is visual visible, that it is not controlled clean. (Flickering on rerendering by statechanges).

Because of the eventRenderer, this also accepts only string as return. So I use also dom-mutation:

  const wrapper = document.createElement("div");
  wrapper.id = `wrapper_${eventRecord.id}`;
  wrapper.className = "wrapper_eventButtons";
  // Add the event text to the wrapper
  const eventText = StringHelper.xss` ${eventRecord.name}`;
  const eventTextEl = document.createElement("span");
  eventTextEl.innerHTML = eventText;
  wrapper.appendChild(eventTextEl);
  const buttonContainerId = eventRecord.id
    ? String(eventRecord.id)
    : String(eventRecord.id).split("_")[2].toString();
  // Get allready existing buttonContainer container or create a new one
  let buttonContainer = document.getElementById(buttonContainerId);

if (!buttonContainer) {
    buttonContainer = document.createElement("div");
    const root = createRoot(buttonContainer);
    root.render(
      <EventButton
        ...props
      />
    );
  }
...
furtherCodeLogic here.....

wrapper.append(buttonContainer);

So we render an InconButton in events
Image

The ones in the green events (timerecords) are ReactComponents with further logic:
Image

So can't await the feature!

Have a nice weekend!
greetings from Singhammer


Re: [REACT] Add JSX Element in Resource Header.

Posted: Fri Jul 28, 2023 5:52 pm
by tasnim

Hi,

Thank you so much for showing your interest on that feature request. I've added a comment to the existing ticket, to emphasize the priority of this feature.

Warm regards,
Tasnim


Re: [REACT] Add JSX Element in Resource Header.

Posted: Mon Aug 21, 2023 9:51 am
by saki

There are several JSX-related tickets that request the implementation of React support in various places. To clarify, here is the list, in the order of slated implementation:

  1. https://github.com/bryntum/support/issues/5808
  2. https://github.com/bryntum/support/issues/7342
  3. https://github.com/bryntum/support/issues/7340
  4. https://github.com/bryntum/support/issues/7341