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

Hide close icon on window

13 Answers 3553 Views
Window
This is a migrated thread and some comments may be shown as answers.
Donna Stewart
Top achievements
Rank 1
Donna Stewart asked on 27 Jun 2012, 03:45 PM
Is there any way to hide the close icon on the kendo mvc extension window?

Thank you,
Donna

13 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Jun 2012, 09:25 AM
Hi Donna,

Similarly to the MVC Window, the Close button of the Kendo UI MVC Window is hidden by not including it in the buttons collection:

.Actions(actions => actions.Maximize())

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Donna Stewart
Top achievements
Rank 1
answered on 28 Jun 2012, 02:59 PM
Hi Dimo,

Thank you for your response.  I would like to not have any buttons on my window.  I tried the following code but it didn't work.  Is there a way to have no buttons?  Thank you so much!

Donna
@{
    ViewBag.Title = "Index";
}
@(Html.Kendo().Window().Name("surveyWindow").Title("GMC Survey")
    .Width(750).Height(450).HtmlAttributes(new {style = "font-size:1.5em;"}).Actions(a => a.Clear())
    .LoadContentFrom("SurveyQuestion", "Home", new {questionNum = 1}).Events(e => e.Open("doOpen")))
 
<script type="text/javascript">
    function doOpen() {
        var kendoWindow = $("#surveyWindow").data("kendoWindow");
        kendoWindow.center();       
    }
</script>
 
<style type="text/css">
div.k-window-titlebar
  
{
    font-size: 1.75em;
    line-height: 1.2;
    color: #719501;
}
</style>
1
Accepted
Dimo
Telerik team
answered on 29 Jun 2012, 05:46 AM
Hi Donna,

I am afraid the Window is not designed to have no buttons at all, but you can hide the remaining Close button with CSS:

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

Note that if used globally, the above style will influence all buttons on all pages.

All the best,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Donna Stewart
Top achievements
Rank 1
answered on 03 Jul 2012, 04:15 PM
Yes, that worked.  Thank you!
0
Atanu
Top achievements
Rank 1
answered on 16 Nov 2012, 05:33 AM
Is there any way to do the same from javascript so that it effect only a single window and not influence other windows.

Looking forward to your reply.

Thanks
0
Evan
Top achievements
Rank 1
answered on 20 Nov 2012, 05:42 PM
$("#MyPopup").parent().find(".k-window-action").css("visibility", "hidden");
0
Nathan
Top achievements
Rank 2
answered on 06 Jun 2013, 02:13 PM
That's still wrong that will still do it to every window!

Not this:
$("#MyPopup").parent().find(".k-window-action").css("visibility", "hidden");
this
$("#MyPopup").find(".k-window-action").css("visibility", "hidden");
0
Evan
Top achievements
Rank 1
answered on 06 Jun 2013, 03:10 PM
Um, no, yours doesn't even work. Try testing your code out before accusing someone else of posting wrong code.

If you actually look at the DOM rendered by the popup windows, the reason mine works is because the element with class of "k-window-action" is actually a SIBLING of #MyPopup, not a descendent. You have to get the direct parent of the popup element and then find the k-window-action within.

Yours will not find ANY k-window-action elements within #MyPopup and will do nothing at all.

http://jsfiddle.net/xg5G7/19/
0
Nathan
Top achievements
Rank 2
answered on 06 Jun 2013, 04:35 PM
Many apologies, no offence was intended.

My bad, it's because I was using the wrapper:

$("#window").data("kendoWindow").wrapper.css({ height: 112, width: 230, left: 220, top: 72 }).find(".k-window-action").css("visibility", "hidden");

0
Sreejith
Top achievements
Rank 1
answered on 13 Apr 2016, 01:22 PM

Also with the latest build as of today,  you can use 

 .Actions(actions => actions.Clear())

 

@(Html.Kendo().Window()
            .Name("popupWin")
            .Title("Select a Search Service Account")
            .Actions(actions => actions.Clear())
            .Visible(false)
            .Width(500)
            .Height(185)
            .Draggable()
            .LoadContentFrom("GetData", "Home")
            .Modal(true)
            .Events(e => e
            .Open("onWinOpen")
            .Refresh("onWinRefresh")
            .Error("onVarValWin_Error")
          )
    )

 

Thanks

Sree

0
Summit Insights
Top achievements
Rank 1
answered on 06 Jul 2016, 01:53 AM

Hi,

In my scenario I have two actions in the action bar as follows:

$("#requestWindow").kendoWindow({
        draggable: false,
        resizable: false,
        modal: true,
        title: "My title",
        actions: ["Refresh", "Close"]
    });

What I want is to only hide one of the actions.

This will hide both actions:

$("#requestWindow").parent().find(".k-window-action").css("visibility", "hidden");

And this hides one option but you can still hover the "invisible" button (see attached image):

$("#requestWindow").parent().find(".k-i-refresh").css("visibility", "hidden");

 

Any ideas on how to prevent this "hovering" effect?

 

Cheers

 

1
Dimo
Telerik team
answered on 06 Jul 2016, 07:58 AM
Hi Ron,

The provided code hides a specific icon, but leaves its parent button visible. The correct approach is to hide the parent button.

.....find(".k-i-refresh").parent().css("visibility", "hidden");


Regards,
Dimo
Telerik by Progress
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
Felipe
Top achievements
Rank 1
commented on 06 Apr 2022, 02:19 PM

Thanks, this saved my day
0
Summit Insights
Top achievements
Rank 1
answered on 06 Jul 2016, 11:10 PM
Thanks Dimo, that worked!
Tags
Window
Asked by
Donna Stewart
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Donna Stewart
Top achievements
Rank 1
Atanu
Top achievements
Rank 1
Evan
Top achievements
Rank 1
Nathan
Top achievements
Rank 2
Sreejith
Top achievements
Rank 1
Summit Insights
Top achievements
Rank 1
Share this question
or