Our blazing fast Grid component built with pure JavaScript


Post 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 .

Attachments
grid_Bryntum.zip
(1.61 MiB) Downloaded 49 times
Screen Recording 2022-11-07 at 5.54.33 PM.mov
(2.47 MiB) Downloaded 43 times

Post 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 477 times

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


Post 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

Regards
Joakim


Post 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.

All the best,
Alex


Post 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 ?


Post 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.

All the best,
Alex


Post Reply