getNode question

Hi,
Probably again a very elementary question, however I cannot get round how to solve it. My feeling is that when i call the function like here: http://webix.com/snippet/3937af9e

the webix ui has not yet loaded. Could that be it? How do i avoid it? if i stick the call after the webix.ui call it would work, but only in the snippet, not on my project.

thanks for your help!

You can try to use webix.ready(executeAtStart); , and it need to be placed after webix.ui call anyway.

http://webix.com/snippet/f4f9034d

hi and tks for your answer!
that sort of solves the issue to a certain extent, but not always. could u pls explain what’s wrong with my approach exactly?

I have a promise function that need to run getNode too and the two getNode seem to not be able to run together. I will try to build a snippet example.

tks!

The code which you are using is mostly fine.

webix.ui is placed in webix.ready, that means it will be processed only after document loading and some webix initialization, so if you want to be sure that your code can access the UI you need to run it through webix.ready as well.

There is no any other quirks. As far as webix.ui called, UI must be accessible and getNode must work.

thank you MAxim,

so… an approach like:

webix.ready(function(){
mainstructure = new webix.ui({
[…webix.ui config…]
})
$$(‘whatever’).getNode();
})

should also always work…?

regards,
valerio

yes, it must work correctly

if you have a case when it somehow doesn’t work, please share a snippet or a demo link