Set id for GridRowProps

1 Answer 191 Views
Grid
Rémi
Top achievements
Rank 1
Rémi asked on 04 Aug 2022, 03:36 PM

Hi,

There is an easy way for setting the prop id on rowRender or I have to do that :

 

rowRender = (trElementdataItem, myId=> {
    const trProps = {

      id: myId,

      ...trElement.props,

 

    };
    return React.cloneElement(trElement, { ...trProps }, trElement.props.children);

  }

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 08 Aug 2022, 11:20 AM

Hello Rémi,

The Grid does not provide an option for rendering an ID for each row, so the approach that you have found is the one that should be used for adding it to each TR element.

 

Best Regards,
Konstantin Dikov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Rémi
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or