Dynamically change window actions

4 posts, 0 answers
  1. Dörig Adrian
    Dörig Adrian avatar
    3 posts
    Member since:
    Sep 2002

    Posted 23 Feb 2012 Link to this post

    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
    
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 24 Feb 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Mikkel
    Mikkel avatar
    58 posts
    Member since:
    Aug 2012

    Posted 10 Oct 2014 in reply to Alex Gyoshev Link to this post

    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
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Oct 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready