How to set label caption from ajax call?

Good day webix comunity members.

Can you please advice me how can i set label caption from GET request via ajax?

I’m creating label like that:

{ view: “label”, id:“myelementid”, label: “” + MyFunction() + “”}

How do i write MyFunction() to return ajax GET request text?

Thank you.

You can use

{ view: "label", id:"myelementid", label: ""}

and later

webix.ajax("myfunction.php", function(text){
   $$("myelementid").config.label = text;
   $$("myelementid").refresh();
});

Thank you!