search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to access current column for onBeforeRowHeaderDomAdd?

Asked by andy
1 month ago.

Hello,

When we provide multiple columns for left sidebar, ie:

rowHeaderColumns: [{ id: firstColumn }, { id:  secondColumn }]

Is there a way to access which column are we rendering row header’s content for?

While not obvious, it seems like `args.x` is the current column index being rendered.

Answer posted by Dan Letecky [DayPilot]
1 month ago.

Hi Andy,

Yes, args.x is the column index.

However, I recommend using onBeforeRowHeaderRender instead when possible (you can access the header cell properties using args.rows.columns[] there). The onBeforeRowHeaderDomAdd should be only used if you really need access to the DOM element.

Comment posted by andy
1 month ago.

Hi Dan,

Thanks for the response. We are intentionally using `onBeforeRowHeaderDomAdd` to render JSX with styled-components, since a lot of our reusable components is using this library.

Is `args.x` an official flag, or is it likely changed in the future?

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Thanks for the update. For rendering JSX, there is no other option.

The args.x property is official, and you can rely on it in the future.

Comment posted by andy
1 month ago.

Thank you!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.