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

React Grid

2 Answers 236 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Damiano
Top achievements
Rank 1
Damiano asked on 05 Mar 2018, 07:35 AM

Hi,

I'm playing with the new Kendo React components and in particular the Grid component.

I create a custom cell with a button inside " <Column field="Id" cell={Links} />" , when I click the button inside the Links component I need to propagate the event back to my main component, the one that contains the Grid.

How can I do?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 06 Mar 2018, 09:43 AM
Hello Damiano,

There are several possible ways to do this.

One of them is shown in this example, where the custom column is declarated inside the app class itself. This way the cell lives in the scope of the app: https://www.telerik.com/kendo-react-ui/components/grid/editing/editing/

And if yo need to import the Cell from another file. It is more suitable to create a Higher-Order Component of your cell, and to pass the event handlers that you want to handle in the app. So here is modified version of the demo, but with HOC:
https://stackblitz.com/edit/react-grid-cells?file=commandCell.js

Regards,
Vasil
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Damiano
Top achievements
Rank 1
answered on 06 Mar 2018, 10:43 AM

Thank you very much for your answer and for the example.

This is exactly what I need!!

Regards,
Damiano

Tags
General Discussions
Asked by
Damiano
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Damiano
Top achievements
Rank 1
Share this question
or