Reusable custom component creation problem

Hi,

I would like to create a reusable custom component based on ui.window. This component contains tabview nested in layout (see attached snippet).

The window can be opened several times with different data, i.e. several instances of the window must exists simultaneously.

The problem is that when a second instance of the window is created (webix.ui({view:“popup-editor”})) webix complains about tabview does not have cells (in fact they where deleted when the first instance was created, see webix.protoUI(tabview) in the very end of the $init function)

http://webix.com/snippet/2f140812

Please advise how I can workaround this limitation

P.S. webix-3.2.2

Hi,

please use function to generate UI, for example as in:

http://webix.com/snippet/23c9282d

With your existing code, the configuration of subview will be shared by all instances, which will result in problems. By using function, for UI creation, you will have a new configuration for each instance.

defaults work fine for simple config options. For complex objects and view configs, it will be better to define them dynamically from $init.

Hi Maria,

Thank you very much for this elegant solution!