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

Windows not working

2 Answers 200 Views
Window
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 25 Jun 2015, 03:31 AM

I am not sure when this window stopped working, it was working before. I have made a test and get an undefined error.
We have published a new version of site and this error is live, any ideas I am under pressure to fix this, thanks
Example is on VB

@code
    Layout = Nothing
End Code
 
<link href="~/content/kendo/kendo.common.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.mobile.all.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.dataviz.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.default.min.css" rel="stylesheet" />
<link href="~/Content/kendo/kendo.dataviz.default.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.metro.min.css" rel="stylesheet" />
<link href="~/content/kendo/kendo.default.mobile.min.css" rel="stylesheet" />
<script src="~/Scripts/jquery-2.1.4.js"></script>
<script src="~/Scripts/Kendo/kendo.all.min.js"></script>
 
<script src="~/scripts/kendo/jszip.min.js"></script>
    <script src="~/scripts/kendo/kendo.all.min.js"></script>
        <script src="~/scripts/kendo/kendo.aspnetmvc.min.js"></script>
        <script src="~/scripts/kendo/kendo.modernizr.custom.js"></script>
 
@code
    Dim AlertWindow As Kendo.Mvc.UI.Window = Html.Kendo.Window().Name("AlertWindow").
           Visible(False).Actions(Function(actions) actions.Pin().
                                      Refresh().
                                      Maximize().
                                      Close()).
                                  Width(400).
                                  Title("Warning").
                                  Pinned(True)
    AlertWindow.Render()
End Code
 
 
 
 
 
<script>
    alertWindow("ffffff")
    function alertWindow(message) {
        var win = $("#AlertWindow").data("kendoWindow");
        alert(win)
        win.content(
          "<div class=\"alert alert-warning\">" + message + "</div>"
        );
 
        win.center().toFront().open().restore();
        $("#AlertWindow").closest(".k-widget").css({
            top: 100,
 
        });
    }
 
</script>

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 26 Jun 2015, 01:30 PM
Hi Alan,

You are trying to get the Window widget reference too early. Wrap the Javascript code in a document.ready handler, as explained in the documentation.

http://docs.telerik.com/kendo-ui/aspnet-mvc/fundamentals#client-side-object

Regards,
Dimo
Telerik
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
0
Alan Mosley
Top achievements
Rank 1
answered on 26 Jun 2015, 01:50 PM
Thanks, that example was made in a hurry, and I forgot to put in document ready, but that was not my problem on the site. My problem was a messed up bundling of scripts. I should have cancelled this post, thanks
Tags
Window
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Alan Mosley
Top achievements
Rank 1
Share this question
or