When render function is called?

Hi. i have a problem in my cordova app. I get an error in render function due to some resources are not ready (arrays with map function in teamplate one inside another).

More precisely, i have array1.map (el1 … array2[el1.id]…)

The problem is that i get this error after event pageAfterIn. And this error ocures only when resource1 is ready and resource2 is not. But in pageAfterIn and other events resource1 is not still ready (it is get async from sqlite db on start), but i need it to create resource2, and when page is displayed array1 is somehow always ready,

So which event i can use to create second array?