how window close

Get help with using Metro 4 components
Post Reply
saeedmansoori
Posts: 3
Joined: Wed Apr 11, 2018 2:53 pm
Status: Offline

how window close

Post by saeedmansoori » Sat May 26, 2018 9:07 am

hi...i using metro ui window in project..
how window close by function??
for example:
win.close();
win.remove();
win.onClose();
this not working!!!

User avatar
olton
Site Admin
Posts: 69
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Sat May 26, 2018 10:02 am

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

jorgec79mx
Posts: 1
Joined: Wed May 30, 2018 9:31 am
Status: Offline

Post by jorgec79mx » Wed May 30, 2018 9:33 am

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();

User avatar
olton
Site Admin
Posts: 69
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Wed May 30, 2018 5:17 pm

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

Post Reply