Window ActionsBuilder Clear() method not working

4 posts, 0 answers
  1. Derrick
    Derrick avatar
    8 posts
    Member since:
    Jun 2011

    Posted 14 Mar 2013 Link to this post

    I am using a Kendo Window for my application, and I want to remove the default Close button from the header. I am using the Clear() method, which by definition should clear out all actions. But when I run my application, the close button is still present on the window.

    Here is the Razor code that builds the wondow. Notice the Actions section. Any help would be greatly appreciated! 
    @(Html.Kendo().Window()
        .Name("LoadingWindow")
        .Visible(false)
        .Title("Loading...")
        .Modal(true)
        .Height(150)
        .Width(300)
        .Actions(a => a.Clear())
        .Content(@<text>
                      <div id="loading-details">Loading Data. Please wait.
                          <div id="divLoaderGif">
                              <img src="@Url.Content("~/Content/themes/ajax-loader.gif")" alt="Loading... Please wait..." />
                          </div>
                      </div>
                  </text>)
    )
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 18 Mar 2013 Link to this post

    Hi Derrick,


    Thank you for bringing this issue to our attention. It is indeed a bug and I have logged it for our development team to fix it. As a workaround you could specify the following CSS styles to manually hide the Close button.

    E.g.
    .k-window-action
    {
       visibility: hidden ;
    }

    As a small sign of gratitude I updated your Telerik points. Wish you a great day!

     

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Derrick
    Derrick avatar
    8 posts
    Member since:
    Jun 2011

    Posted 18 Mar 2013 Link to this post

    Thanks, Dimiter. I appreciate the help. Unfortunately, this will not work since I have other Kendo Windows that we use in this app (which we DO want the buttons displayed). And adding this CSS code will hide buttons on all windows. I may need to just wait for the bug fix, and we'll just let the button be visible for now. 
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 19 Mar 2013 Link to this post

    Hi Derrick,


    You could add a custom class to the windows, where the buttons need to be hidden.
    E.g.
    @(Html.Kendo().Window()
        .Name("window")
        .HtmlAttributes(new { @class = "no-buttons" })

    And then hide them via jQuery
    E.g.
    $(".no-buttons").prev(".k-window-titlebar").find(".k-window-action").hide();

    I hope this approach will work in you scenario.

     

    Kind regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready