Author Topic: Looking for function that gives the state of the grid  (Read 1547 times)

angelahlp

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Looking for function that gives the state of the grid
« on: January 27, 2021, 10:30:31 am »
I have functions that I don't want to fire until the grid has loaded. Is there a function that will return whether or not the grid has finished loading? That can be called on the grid object, not done during initialization?

Example:
if editorobj.isLoaded() then do action

I'm looking for the isLoaded() functionality.

TIA

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Looking for function that gives the state of the grid
« Reply #1 on: January 27, 2021, 04:03:50 pm »
are you looking for complete event:

https://paramquery.com/pro/api#event-complete

angelahlp

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: Looking for function that gives the state of the grid
« Reply #2 on: January 28, 2021, 01:54:05 am »
I have a function that is not a part of the grid that is called independent of the grid which highlights a cell in the grid. I don't want to allow that independent function to run unless the grid is loaded.

Is my only option to have a global variable that stores a flag that gets set in the "complete" event?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Looking for function that gives the state of the grid
« Reply #3 on: January 28, 2021, 09:27:46 am »
Why do you need a global flag?

Code: [Select]
grid.on( 'complete', function(){
  //call your function or do whatever you want to do.
});