How to use onReady from Power/Data grid

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

How to use onReady from Power/Data grid

Postby pitc » Fri Jun 18, 2021 1:08 am

The toolTip for the event is:
Called when the table is ready to be shown

the wiki has:
Event executed when the table is ready to be shown.

I think the ag-grid explanation is this:
When the grid is initialised, it will fire the gridReady event. If you want to use the APIs of the grid, you should put an onGridReady(params) callback onto the grid and grab the api(s) from the params. You can then call these apis at a later stage to interact with the grid (on top of the interaction that can be done by setting and changing the properties).


I do not understand the "ready to be shown" in the Servoy wiki..How should it be used? How do others use it?
The reason I ask is that sometimes there are warnings that the element is not yet in the DOM and perhaps I am attempting to change the grid at the wrong time (mostly to do with restoring columns states from a previously saved variable).

For example should I wait until the onReady event is received and not do any grid api changes at all (sometimes the grid might be in a flex layout which is is "hidden") until then?
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: How to use onReady from Power/Data grid

Postby rieder » Tue Jan 30, 2024 10:36 am

+1
Birgit Rieder
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
rieder
 
Posts: 177
Joined: Thu Jan 26, 2012 5:18 pm

Re: How to use onReady from Power/Data grid

Postby swingman » Wed Jan 31, 2024 12:44 am

Hi Tom,

I add a form variable on my form called grid_ready which I set to false.
When the onReady fires on the grid I set it to true.

Before I call the grid API I check whether grid_ready is true.

This technique gets rid of lots of warnings in the logs.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 11 guests