Declined
Last Updated: 27 Mar 2023 10:48 by Agnieszka
Agnieszka
Created on: 24 Mar 2023 12:39
Category: KendoReact
Type: Feature Request
0
Pass row index to rowRender function in kendo react grid

Currently, there is a following signature of function "rowRender" passed to React Grid:

rowRender?: (row: React.ReactElement<HTMLTableRowElement>, props: GridRowProps) => React.ReactNode;

I managed to access something which I assume represents this index somehow by using "row._owner.index" although I'm not completely sure if that is always identical to the index of the row being rendered.

It would be very helpful if an index of a rendered row could be accessed as follows:

rowRender?: (row: React.ReactElement<HTMLTableRowElement>, props: GridRowProps, index: number) => React.ReactNode;

 

 

 
2 comments
Agnieszka
Posted on: 27 Mar 2023 10:48
Thank you. I somehow thought that this is something else. 
ADMIN
Konstantin Dikov
Posted on: 24 Mar 2023 13:21

Hi Agnieszka,

The current implementation of the rowRender passes GridRowProps where you have access to the dataIndex and the ariaRowIndex:

The ariaRowIndex represents the row index within the context of the entire Grid (the index of the TR element, including the TR elements in the header), where the dataIndex returns the index of the data item.

 

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.