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

Using a popup in grid cell and forceUpdate loses position

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 18 Jul 2018, 12:52 PM

I want to show a grid for my custom editor with sorting functionality. I'm able to use Popup and reference the grid row td. Since GridCell isn't generic I can't define my own state so I've resorted to using class properties to store the data & sort order instead. This works but the grid isn't re-rendered on sort unless i .forceUpdate(). When I do that I lose my reference to my anchor point.

Do you think in the future GridCell extends could define their own state? Do you think allowing them to be generic might make sense?

Is there a way to prevent my Popup from losing its positioning?

Working example: https://next.plnkr.co/edit/AynMBNvtloQ881qt

Thanks!

2 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 18 Jul 2018, 01:25 PM
I am still interested in the answers to my questions above. I was able to resolve my issue by instead using a stateful component within my custom GridCell. 
0
Stefan
Telerik team
answered on 19 Jul 2018, 07:06 AM
Hello, Ryan,

I'm glad to hear that the issue was resolved.

Regarding the questions:

1) Please check an issue that we have(with discussion) on why we did not make the cell with the state. Please feel free to join the discussion by providing more points of view:

https://github.com/telerik/kendo-react/issues/10

2) As for a way to prevent the Popup to lose its position. We can suggest on the cell click event to pass the target element as a parameter and keep it in the global level. Then to use this variable as an anchor. I modified the example to demonstrate this:

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

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
Ryan
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or