Popup editor works only once for dynamic form elements

Hi Webix Team,

I would like to create edit form dynamic way. So made the function updateFormElements to generate form elements from var.

When you click at the row once it works fine. Then If you hide editor and click again editor shows nothing.

Is there any way to create edit form before show editor?

Please, see the snippet https://snippet.webix.com/it602cfn

Modified code:

onItemDblClick:function(){

      	updateFormElements();
      
    	$$("editwin").show();
    }
}

function updateFormElements(){
  
  var formElementsConfig = [
    { view:"text", label:"Title", name:"title"},
    { view:"text", label:"Year", name:"year"},
    { view:"text", label:"Votes", name:"votes"},
    { cols:[
      { view:"button", value:"Cancel", click:function(){
        this.getTopParentView().hide(); 
      }},
      { view:"button", type:"form", value:"Save", click:function(){
        this.getFormView().save();
        this.getTopParentView().hide(); 
      }}
    ]}
  ];
  webix.ui(formElementsConfig, $$('editform'));
  
 }

Hello, @Mika

To solve the issue, first of all, you should use webix.copy(formElementsConfig) to have the possibility to use formElementsConfig more than once.
Also, since you change the configuration of the form, it’s necessary to bind it each time the configuration has been changed.
Please, pay attention, that after the window has been hiding, the form should be unbinned.
Here is the snippet: Code Snippet

Hello, Alena,

Ok, thank you!