Page 1 of 1

[REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Mon Nov 07, 2022 3:18 pm
by suhas.kachare

Hi Team ,

I am using Ant's DatePicker component as my custom date editor component . As shown in a below attached screen recording I have used two different custom editors i.e select and date editor . But my date editor is not showing a updated value as onChange method is not getting called and it looses its focus .

But if I use GlobalEvents.suspendEvents() inside a focus method my onChange method gets called and its showing a updated value . But we don't want to use GlobalEvents.suspendEvents() .

So , can you please help us with a proper solution .

Below I attached a test case .


Re: [REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Tue Nov 08, 2022 3:27 pm
by Animal

Is there any very pressing reason you need to use a third party date picker instead of the one provided?

Screenshot 2022-11-08 at 14.25.23.png
Screenshot 2022-11-08 at 14.25.23.png (66.53 KiB) Viewed 537 times

You can of course use your own CSS to change that look.


Re: [REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Wed Nov 09, 2022 11:11 am
by joakim.l

We have created a ticket on this issue. Seems like the solution for your (company) previously related issue didn't fully solve the problem.

https://github.com/bryntum/support/issues/5552


Re: [REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Wed Nov 09, 2022 3:10 pm
by alex.l

You are right, it's focus problem. Cell editor has built to finish editing and apply value on blur event. If custom components used that render dialogs out of scope of cell element (window scope or whatever else), focus lost will be triggered before custom component applied new value.
You need to handle this case manually. There is a workaround in this thread viewtopic.php?f=43&t=22158&start=10
You can find an example in our Grid basic demo for React.


Re: [REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Thu Nov 10, 2022 2:52 pm
by suhas.kachare

We have already implemented the workaround suggested by you in our application, whose zip file is already shared with you . But it is still not working.

Although using GlobalEvents.suspendEvents() in the focus() method of the component it is working fine . But we are not aware of side-effects that might be introduced by using this suspend events method.

Is this something that you would recommend to use ?


Re: [REACT] Cell value is not getting rendered after editing is finished in case of custom DatePicker

Posted: Thu Nov 10, 2022 4:27 pm
by alex.l

We recommend to use our workaround and don't suspend events.
I checked your code and I don't see onChangeHandler for Ant DateField was ever called. Maybe another event of Ant component should be used?
Why don't you use our combo and date picker? it's pretty simple to configure it and style as you need.