get information from parent view

I have the following code

https://snippet.webix.com/rnc0k7x6

thx to @intregal

but I have one problem. How to get data from headquarter when I click “Add Branch”. I want to add some information from HeadQuarter to Branch form.

Thx Webix team

it depends on information you want to get.
check this
https://snippet.webix.com/za0wwwua

thx @intregal. that’s what I want.
can I get variable name from input text parentview, not the value?
I have try several code but still return “undefined” value.

or Can I get counter value from parent. I think my counter var was global. But it’s return undefined value from “branch”.

@frizky
you can store variables in parent config.
just be aware that they are not used attributes or add some prefix.

{
    view:"text",
    placeholder:"Headquarter",
    id: "nama_" + currentCount,
    name: "nama_ " + counter,
    $custom_var1: value1,
    $custom_var2: value2
}

let text = parent.queryView("text");
alert(text.config.$custom_var1);

thx @intregal