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

Dynamically change window actions

3 Answers 336 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dörig Adrian
Top achievements
Rank 1
Dörig Adrian asked on 23 Feb 2012, 04:27 PM
Hi

I created an error window using Kendo UI Window. In some error cases it should be possible to close the window and in some not.
Is there a way to change the window actions dynamically?

I tried:
errorWindow.data("kendoWindow").actions = ["Close"];

Recreated the window to the same id.
Both technics do not work...

Regards
Adrian

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 24 Feb 2012, 08:08 AM
Hello Dörig,

I'm afraid there is no API that lets you to change the window actions dynamically. A work-around for that is to hide the unneeded buttons (in this case, the close button). This can be done like this:

$("#window").closest(".k-window").find(".k-close").parent().hide(); // or show()
  
Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Lasse
Top achievements
Rank 1
answered on 10 Oct 2014, 10:28 AM
Hi Alex,

There are a few of the window options or parameters that cannot be set using the setOptions method. I know that it doesn't work for parameters "actions" and "content", but why?

It is a bit annoying that parts of the API is not logical/intuitive and consistent. Also your documentation doesn't mention anything about which parameters can be passed to setOptions.

Generally I'm missing a more comprehensive documentation on the controls in your JavaScript/JQuery API - like description of methods and paramters etc. Is it available somewhere that I don't know of?

Usually I'm consulting pages like http://docs.telerik.com/kendo-ui/api/javascript/ui/window#methods-setOptions.

Just a few thoughts.

/Mikkel
0
Alex Gyoshev
Telerik team
answered on 14 Oct 2014, 11:10 AM
Hello Mikkel,

This is indeed a bug in the setOptions method, and we have logged it for fixing. The reason for these inconsistencies in the setOptions method is that it was previously for internal use, but was exposed due to popular demand. Although it has limited functionality, it is still useful to some customers. The API page does not mention these limitations, because we strive to fix them in a timely manner. The recommended approach when setOptions does not support an option is to report it and re-cycle the widget (destroy/init) until it is introduced.

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
Dörig Adrian
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Lasse
Top achievements
Rank 1
Share this question
or