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

Custom editor that works with example pattern for onClick renders edit

1 Answer 208 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 17 Jul 2018, 02:35 PM

I put together this plunkr to demonstrator my problem. I want to have a custom editor, but I also want to be able to switch the cell to edit mode onclick. The problem is with how editors are defined I can't pass in arguments to a constructor that could reference the enterEdit method like is shown with renderers.jsx. Columns that have cell defined skip the cellRender routine. I don't see any way to bind my custom editor cell to support an onClick method similar to how non-custom cells can. Help appreciated

https://next.plnkr.co/edit/JK1J5RxG2C6uBqrr

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 18 Jul 2018, 07:50 AM
Hello, Ryan,

This is the expected behavior when a custom cell is used, as internally we are adding a check to call the renderer in specific cases.

In order to achieve the desired result, the same code has to be added in the custom cell.

The logic is to check if there is a render and to call it:

return this.props.render
    ? this.props.render.call(undefined, defaultRendering, this.props)
    : defaultRendering;

I modify the provided example as well:

https://next.plnkr.co/edit/jKN4MGY5IHhYYcie

I hope this is helpful.

Regards,
Stefan
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
Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or