ScopiaRx_CTO
Top achievements
Rank 1
ScopiaRx_CTO
asked on 23 Jan 2013, 04:04 PM
I need to check if the Window is already open, since calling open again on a centered window that has been dragged re-centers it. What's te best way to determine if the window is already open?
6 Answers, 1 is accepted
0
Accepted
Hello Karl,
To determine whether a given Window widget is opened or not, you may check if it is hidden.
Kind regards,
Alexander Valchev
the Telerik team
To determine whether a given Window widget is opened or not, you may check if it is hidden.
var
wnd = $(
"#window"
).data(
"kendoWindow"
);
wnd.element.is(
":hidden"
);
//returns true or false
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
akj
Top achievements
Rank 1
answered on 28 Nov 2013, 02:17 AM
That works . Thanks
0
Jarno
Top achievements
Rank 1
answered on 02 Sep 2014, 07:37 AM
Does this really work? It's always false.
0
Hello Jarno,
Could you please provide a small Kendo Dojo sample which demonstrates your exact scenario?
Regards,
Alexander Valchev
Telerik
Could you please provide a small Kendo Dojo sample which demonstrates your exact scenario?
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jarno
Top achievements
Rank 1
answered on 02 Sep 2014, 09:23 AM
http://dojo.telerik.com/IFeVe/9
Updated Dojo. So i want to close Window when TabStrip tab changes.
Updated Dojo. So i want to close Window when TabStrip tab changes.
0
Hi Jarno,
In your case there is no need to check if the Window is opened or not, instead may directly call the close() method of the widget. The widget will check internally if it is currently opened or not and will handle the action accordingly. You should to check only if the widget is initialized. Please see the code sample below.
Regards,
Alexander Valchev
Telerik
In your case there is no need to check if the Window is opened or not, instead may directly call the close() method of the widget. The widget will check internally if it is currently opened or not and will handle the action accordingly. You should to check only if the widget is initialized. Please see the code sample below.
function
closeWindow() {
var
wnd = $(
"#sample-wnd"
).data(
"kendoWindow"
);
if
(wnd) {
wnd.close();
}
}
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!