Strange webix behavior.

When I try to use the same configuration to create different components, I get an error.

https://snippet.webix.com/uwpe2ja4

Tagged:

Comments

  • it is expected behavior.
    to avoid you need to use copy of configuration.

    var cfg = {...};
    var obj1 = webix.ui(webix.copy(cfg));
    var obj2 = webix.ui(webix.copy(cfg));
    
  • @intregal
    Thank you for the answer, but unfortunately, this decision is not always helpful.

    https://snippet.webix.com/9m1odvcs

  • @lBeJIuk
    yes, with complex properties (like DataCollection, Promise) copy is not the solution.
    webix should rewrite its logic.
    as a workaround you can use webix.clone instead.
    https://snippet.webix.com/v1b4ncz9
    it works for single level objects.
    not sure if it will have problems with deeper one (like datatable config)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion