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

[Solved] Closing Telerik.Window does not work without Telerik JQuery

2 Answers 128 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Glenn Henriksen
Top achievements
Rank 1
Glenn Henriksen asked on 07 Jan 2011, 11:51 AM
This is a rather obscure one. 

I include JQuery scripts at the top of my page and the ScriptRegistrar at the bottom.
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.4.3.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.form.js")"></script>

  @Html.Telerik().ScriptRegistrar().jQuery(false).Globalization(true).DefaultGroup(group => group
   .Add("telerik.common.min.js")
   ....
   .Add("telerik.grid.filtering.js")
  )
</body>

With jQuery disabled in the ScriptRegistrar so it won't destroy the jQuery UI and Validation bindings. This works fine, except for one ting. When we use jQuery Window the close button in the top right corner does not work. Tested in Firefox 3.6.13 and IE8. 

If I remove the .jQuery(false) the close button works (but all the jQuery UI/Validation stuff breaks).

Using version 2010.3.1110.340 of the Telerik.Web.Mvc.dll

Moving the jQuery scripts to the bottom of the page is not an option since $(document).ready() is used in several places. I tried loading just jQuery at the top and all the other scripts after the Telerik ScriptRegistar (that also loaded jQuery) but that gave the same error. 

Any thoughts to what I'm doing wrong? 

2 Answers, 1 is accepted

Sort by
0
Michael Baird
Top achievements
Rank 1
answered on 12 Jan 2011, 11:21 PM
I'm experiencing the same issue but only in Firefox 3.6 and also it doesn't matter if I use
.JQuery(false)
or
.JQuery(true)
or exclude it entirely....the modal window will not close in FF, only in IE.

my example code:

ViewPage:

<input type="button" id="btnUpload" name="btnUpload" value="Upload Files" />
 
<% Html.Telerik().Window()
                .Name("UploadWindow")
                .Title("Upload Files")
                .Draggable(true)
                .Resizable(resizing => resizing
                        .Enabled(true)
                        .MinHeight(250)
                        .MinWidth(300)
                        .MaxHeight(500)
                        .MaxWidth(500)
                )
                .Modal(true)
                .Buttons(b => b.Close())
                .Content(() =>
                {%>
                    <div id="container">
                        <a id="pickfiles" href="#">Select files</a>
                        <a id="uploadfiles" href="#">Upload files</a>
                    </div>
                <%})
                .Width(500)
                .Height(500)
                .Visible(false)
                .Render();
%>
 
<% Html.Telerik().ScriptRegistrar()
                           .OnDocumentReady(() =>
                                    { %>
                                        $('#btnUpload').click(function() {
                                            $('#UploadWindow').data('tWindow').center().open();
                                        });
 
                    $('.t-close').click(function() {
                                            $('#UploadWindow').data('tWindow').close();
                                        });
<% }); %>


To get around the issue, I added this code to force the window to close with an onclick event and work in FF:
$('.t-close').click(function() {
  $(
'#UploadWindow').data('tWindow').close();

});
0
Alex Gyoshev
Telerik team
answered on 13 Jan 2011, 09:59 AM
Hello all,

I could not reproduce this problem with the latest version of the assembly. You can find it attached to this post, along with the solution used for testing.

Best wishes,
Alex Gyoshev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Glenn Henriksen
Top achievements
Rank 1
Answers by
Michael Baird
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or