Dynamic UI Modification with two Counter in a Form

Hi webix team, in the snippet https://webix.com/snippet/796236d5 I create dynamicly a form with two counter.

First option: I create two counter in the createElements() function and change the view with: webix.ui({view:“form”, id:“myform”, elements:elements}, $$(‘content’)); the counters appears, but when I click at the plus sign of the first counter, the input value of the second counter is changed.

Second option: I create the counters with the myElements variable and change the view at line 30 to webix.ui({view:“form”, id:“myform”, elements:myElements}, $$(‘content’)); the counters appears and works correctly.

Thanks for advice

that is because you pass the same object as second counter’s config.
and when second counter is created, first’s id is changed too and then first counter is malfunctioned.
to prevent such behavior you need to pass a copy of config as second one.
https://webix.com/snippet/7ba8e69c

Thanks integral for the nice solution!