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

Duplicate Restore Action Buttons on Window

2 Answers 206 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 29 Apr 2016, 05:07 PM

Hello, I'm getting very strange behavior on my action buttons on a Kendo Window. I'm currently on UI for ASP.NET MVC 2015.2.805, should I upgrade? ( i see UI for ASP.NET MVC Q1 2016 SP1 has Minimize / maximize events listed, any benefit?)

My setup is, a main view which loads a window, which contents are a kendo scheduler.  Here is the razor declaration for the window.

@(Html.Kendo().Window()
    .Name("shedulerWindow")            
   
.Title("Scheduler Window")      
    .Content(@<text>@Html.Action("_EvaultBackupSchedulerPopOut", "Dashboard")</text>)
    .Draggable()     
    .Resizable()    
    .Width(1285)      
    .Height(545)    
    .Position(settings => settings
           .Top(178)
           .Left(495)
           )
     .Actions(actions => actions              
                   .Minimize()                                 
                   .Custom("Maximize")                                 
                   .Custom("close")               
                    )
     .Events(ev => ev                                 
     .Close("onClose")
     )          
)

 

You'll notice i've started over-writing all of the real close and maximize actions with custom ones, simply because they don't work correctly out of the box; ie.Close never consistently fired my onClose method (50% or less). Maximize and restore were not working correctly and still not.

Now what's happening, when I maximize, I get two restore buttons show up which do not actually work correctly either.
Look at my 'restore code' image of how the HTML renders out.
Look at the restore icons to see what shows up.

 

 

2 Answers, 1 is accepted

Sort by
0
Rob
Top achievements
Rank 1
answered on 29 Apr 2016, 05:52 PM

So after playing with this for a bit, I found more strange behavior.

I even with .Custom("Maximize") or .Custom("maximize") and EVEN .Custom("maximize-custom") the action would call my custom method and then immediately call its internal maximize methods. Even if I put in preventdefault, it still fires!

So i renamed it to .Custom("custom-max")
then used this 

$(".k-i-custom-max").click( function (e) {
            $("#shedulerWindow").data("kendoWindow").maximize();  
});

And its working perfectly... what gives?

0
Konstantin Dikov
Telerik team
answered on 03 May 2016, 11:58 AM
Hi Rob,

The "Maximize" word seems to be interpreted like the built-in maximized button, despite the fact that there might be something else after the name. If you avoid starting the custom commands with the built-in ones, there  should be no problems.

As for the initial problems that you are facing with the built-in buttons, can you please upgrade to the latest version and see if they could be replicated? If so, you can report the exact bugs, so we can forward them to our developers team.
 

Best Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Window
Asked by
Rob
Top achievements
Rank 1
Answers by
Rob
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or