xh / hoist-react

🏗️ ⚛️ The XH Hoist toolkit for React
https://xh.io
Apache License 2.0
24 stars 9 forks source link

GridModel.selectAsync() does not work without this.whenReadyAsync() #3123

Closed john-xhio closed 2 years ago

john-xhio commented 2 years ago

GridModel.selectAsync() requires await GridModel.whenReadyAsync(); to function. (similar to selectFirstAsync) Can it be baked into the function?

In situations where you want to default the grid selection to a specific row immediately after a load you have to wait for the grid to be ready or the row will not be selected.

lbwexler commented 2 years ago

Uugh. Thanks for reporting this. Did not expect this. Will look into this tomorrow.

lbwexler commented 2 years ago

Hi John -- sorry for the delay on this.

Can you upgrade to v51, and set the experimental flags for grid (config key xhGridExperimental) to

{ "syncDataImmediately": true }

this should fix your problem. Hopefully it does not break anything else (would love your confirmation of that for your app) Its looking like this will become the standard setting in the toolkit in v52

john-xhio commented 2 years ago

Awesome, I will rewind my temporary fixes and try it out. Thank you!

lbwexler commented 2 years ago

[it worked for John]

lbwexler commented 2 years ago

Closing this -- we are making the flagged fix the default behavior in v 52.