Loading external html template

I’m wondering if there’s a way to get the webix components to work with the html template elements?

I know I can refer out to an external JS file that includes the markup as the first example, but writing html templates in JS is a pain. Any tips or tricks on a better way of handling this?

Please disregard. I figured it out.

By default, ui.template expects that request initialized as src:"/url" will return a string with plain text/html tags. To load the pure HTML, use the corresponding prefix:

template:"http->template.html"

To reload such template, you can do the following:

  • apply define+refresh:
var url = "/template.html";
$$("tempId").define({template:"http->"+url});
$$("tempId").refresh()  
  • or via AJAX:
webix.ajax("/template.html").then(function(resp){
  $$("tempId").setHTML(resp.text())
});