This is a migrated thread and some comments may be shown as answers.

Passing Props to Detail row component

2 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Howard
Top achievements
Rank 1
Veteran
Howard asked on 04 Jul 2020, 07:45 PM
Is it possible to pass props to the Detail Row Component from the parent grid component?

2 Answers, 1 is accepted

Sort by
0
Howard
Top achievements
Rank 1
Veteran
answered on 04 Jul 2020, 08:12 PM

I figured out a manner in which to pass the data I wanted by assigning the data as part of the dataItem object that is sent to the detail grid during the expand change event.

 

expandChange = (event) => {
        event.dataItem.expanded = !event.dataItem.expanded;
        event.dataItem.midLevelColumns = this.props.midLevelColumns
        this.forceUpdate();
   }
0
Accepted
Stefan
Telerik team
answered on 06 Jul 2020, 05:23 AM

Hello, Howard,

Thank you for sharing a possible solution with the KendoReact community, it is highly appreciated. 

We can also recommend using a function that will return the detail component plus the custom props. The approach can be seen for custom cells, but the same one can be used for the details as well:

https://www.telerik.com/kendo-react-ui/components/grid/cells/#toc-customization

I hope this is helpful.

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Howard
Top achievements
Rank 1
Veteran
Answers by
Howard
Top achievements
Rank 1
Veteran
Stefan
Telerik team
Share this question
or