is it possible to get windows id to close it ? I generate many windows with the same id, and when i want to close one, i can’t.
ya I have ever tried with getParentView() but i can’t get the specific id of my view because getParentView doesn’t return id view in object returned.
webix.ui({
view:"window",
id : id, //random id generated
head:{
view:"toolbar",
cols:[
{view:"label", label: "my window" },
{ view:"button", label: 'Close window', width: 100, align: 'right', click:function(){
var close = $$(this).getParentView();
//how to do to get id view
$$(id).close(); //I must get id of my view I want to close
}
}
]
},
Sorry, but it is not clear how you want to use this functionality.
You can use getParentView or similar API to get window object from any other view in the target window.
Try to use
$$(this).getTopParentView().close();
Also, for the really random id, code can be written like next
var id = webix.uid(); //trully unique
webix.ui({
view:"window",
id : id, //random id generated
head:{
view:"toolbar",
cols:[
{view:"label", label: "my window" },
{ view:"button", label: 'Close window', width: 100, align: 'right', click:function(){
$$(id).close();
}
}
]
},
thanks