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

store window minimize state

1 Answer 212 Views
Window
This is a migrated thread and some comments may be shown as answers.
Maksim
Top achievements
Rank 1
Maksim asked on 30 May 2013, 10:11 AM
Hi!

There is dashboard  page with several kendo window objects.
I'd like to store window size, position, minimize state and z-order

I was able to retrieve and save window postion and size
('#div_widget').kendoWindow ({
    actions: ["Refresh", "Maximize", "Minimize"],
    height : get_widget_setting (id_widget, "height", "300px"),
    width  : get_widget_setting (id_widget, "width", "600px"),
    minWidth: 600,
    minHeight: 260,
    title  : w.label,
    iframe : true,
    content: w.href,
    resize : function(e){
     var widget = e.sender.element.data("kendoWindow");
 
        var is_maximized = widget.options.isMaximized; // Is this a dirty hack? Are there another ways?
        if (is_maximized) {
            set_global_setting ("maximized_widget", id_widget);
            return;
        }
 
        var wrapper = widget.wrapper;
        save_widget_setting(id_widget, "height", wrapper.css("height"));
        save_widget_setting(id_widget, "width", wrapper.css("width"));
    },
    dragend : function (e) {
        var position = e.sender.element.data("kendoWindow").wrapper.offset();
        save_widget_setting(id_widget, "top", position.top + "px");
        save_widget_setting(id_widget, "left", position.left + "px");
    }
})

- How can I catch minimize button click? I want to save window maximize/minimize state.
- Is there a way to determine window z-order change event and window currrent z-order?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 May 2013, 01:20 PM
Hi Maksim,

Using options.isMaximized or options.isMinimized is OK, however, the resize event is not fired when the user maximizes or minimizes the Window, so they will always return false in this case. We will consider changing the implementation with this regard.

Currently you can detect minimized / maximized state when checking the Window's options at some arbitrary time. You can also attach a custom handler to the Window buttons.

$(".k-window-action").on("mousedown", function(e) {
    var isMinimizeButton = $(this).children(".k-icon").hasClass("k-i-minimize");
});


The Window's z-index is applied to the Window wrapper element.

Regards,
Dimo
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
Maksim
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or