Page 1 of 1

how window close

Posted: Sat May 26, 2018 9:07 am
by saeedmansoori
hi...i using metro ui window in project..
how window close by function??
for example:
win.close();
win.remove();
win.onClose();
this not working!!!

Re: how window close  

Posted: Sat May 26, 2018 10:02 am
by olton
1. Get window instance and call method close

Code: Select all

var win = $(el_selector).data('window');
win.close();
2. Use object Metro.window

Code: Select all

Metro.window.close(el_selector)
https://metroui.org.ua/windows.html

Re: how window close

Posted: Wed May 30, 2018 9:33 am
by jorgec79mx
i am triying to close the window too, this is my code:
Desktop.createWindow({
width: $(window).width()
,height: $(window).height()
,icon: "<span class='mif-search'></span>"
,title: "Buscar Desarrollador"
,content: tbDesarrollador
});

where is my selector? (el_selector)??

var win = $(el_selector).data('window');
win.close();

Re: how window close

Posted: Wed May 30, 2018 5:17 pm
by olton
to get window instance from this function, you must rewrite method createWindow for returning window instance.

https://github.com/olton/Metro-UI-CSS/b ... top.js#L40