This is a migrated thread and some comments may be shown as answers.

Iterating through all Kendo Windows on a page

1 Answer 148 Views
Window
This is a migrated thread and some comments may be shown as answers.
Stewart
Top achievements
Rank 1
Stewart asked on 05 Jun 2014, 04:05 PM
Hi,

I hope this is something relatively simple to ask, I have looked around a little and couldn't find a decent enough resource to solve me problem.

I want to find all kendo windows on a given page without having to reference their id's. The purpose of this is that I am attempting to resize all kendo windows based on when the browser window resize event fires. 

Whilst it could be possible to store an array of window id's I would prefer to not have to maintain that additional code.

Thank you in advance for any assistance you can provide.

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 Jun 2014, 08:24 AM
Hello Stewart,

The elements that hold the window instance have a data-role attribute. Thus, the following code will get them all:

$("[data-role=window]").each(function() {
    var windowObject = $(this).data("kendoWindow");
    // use the window client-side object
});

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
Stewart
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or