Strange webix behavior.

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



  • 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.

  • @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.
    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