Property view replacement (incl. type select) throws exceptions

Hi Webix Team,

when I want to replace the property view and this view contains elements with type “select” than the layout can be replaced only one time (see: Code Snippet)
The second time throws an exception:

Uncaught TypeError: Cannot read properties of null (reading 'pull')
    at Object.template (mapcollection.js:101:26)
    at e.tt (htmlform.js:150:16)
    at e.render (template.js:44:9)
    at e.$setSize (htmlform.js:150:16)
    at e.au (datafilter.js:182:32)
    at e.au (layout.js:33:69)
    at e.$setSize (layout.js:33:69)
    at e.resizeChildren (datafilter.js:182:32)
    at e.resizeChildren (layout.js:33:69)
    at e.nd (datafilter.js:182:32)

If I use property view without type select than it works.
Do you know why?

Best Regards
Michael

Good day @qeychon!

The initial object with your config mutates when it is initialized via webix.ui(), so it cannot be reused.
The component uses the options property to initialize a DataCollection bound to the field where it was defined. Reusing the same object in this case means that you are trying to rebuild the UI using the old data source (that same DataCollection is already set in the initial object instead of the initial array with options, meaning we can’t reuse it).

We advise you to work with copies of configs or copies of data. The library has the webix.copy() helper for this purpose, which can be used in a similar way: Code Snippet

1 Like