Good day, I'm trying to get a better understanding of the DataSet onReady event handler.
I recently had an issue with two datasets, for which I found a workaround -
and I want to know if my solution will continue to perform, and if it was the best fit.
Here is the scenario :
Both datasets are setup to populate page elements through the editor, as well as through code (and this works as designed).
I recently made some changes to the code logic, which resulted in DataSet_02 being dependent on some information from DataSet_01.
I have the of the onReady event handler, for both datasets, inside the onReady event handler for the page - the issue was that, the event handlers for the datasets were being fired at almost the same time, and on some occasion, the event handler for DataSet_02, fired before that of DataSet_01 - which, in both cases, would leave DataSet_02 without the required info. from DataSet_01.
I tried a few fixes, then reluctantly decided to place the onReady event handler for DataSet_02, inside the onReady event handler for DataSet_01 (with both still inside the onReady event handler for the page).
It works like a charm - however, my confusion is this - with my understanding of event handlers (of how and when they execute) and the fact that, in the previous code structure, both were being fired simultaneously, and sometimes one before the other...
...is it then possible, that having the onReady for DS_02, inside the onReady for DS_01, cause the onReady for DS_02 to be sometimes "missed", is there comes a time when DS_01 actually becomes "ready" before DS_02 ???
Any clarification is much appreciated, thanks.