Dynamic UI building - how to?

Hello.

I followed the documentation about dynamic UI replacing or rebuilding but I cannot manage to achieve more than one replace or rebuild.

Let’s look at this snippet to illustrate : http://webix.com/snippet/b77ee730

Of course, my use case will be more complex (dynamic views loaded by ajax call) so the goal is not to use something like a mutliview. I want to be able to click on a button, load a view, display it in a view. Click on an other button, then load a view, and replace the previous one. And so on… What’s wrong with my snippet?

Thanks for your advice,

Jonathan

Check the update snippet

http://webix.com/snippet/fa740e68

In the original code you are replacing the “content” template on first call. So on time of second call there is no “content” template so target for new UI can’t be located.

In updated snippet code replaces the content of layout, but layout itself stays in place, and can be reused in future calls.

I had tried something like this but I the views were added not replaced. The reason is you use webix.ui([ {…} ]) and not webix.ui({…}) :slight_smile:

Thank you for your fast answer!