Unable to get property 'open' of undefined or null reference

4 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 05 Feb 2013 Link to this post

    I cant seem to get window to open, I get error
     Unable to get property 'open' of undefined or null reference

    $("*[data-add-team]").click(function () {
        var win = $("#teamWindow")
        win.show().data("kendoWindow").open().center().toFront();
    })
        <div data-menu-item="teams">
            @code
                Dim TeamCreateWindows As Kendo.Mvc.UI.Window = Html.Kendo.Window() _
                                                                   .Name("teamWindow") _
                                                                       .Title("Create Team") _
                                                                       .Actions(Sub(actions)
                                                                                        actions.Custom("custom")
                                                                                        actions.Minimize()
                                                                                        actions.Maximize()
                                                                                        actions.Close()
                                                                                End Sub) _
                                                                            .LoadContentFrom("create", "team", New With {.area = "contractor"}).Animation(True) _
                .Content(Sub()
        @<text>
        Loading.......
        </text>
                         End Sub) _
            .Draggable().Resizable().Width(500)
         
        TeamCreateWindows.Render()
    End Code
                @Html.Button("addTeam", "Add Team", BO.Enumerators.ButtonType.Button, BO.Enumerators.ButtonStyle.LoLight, New With {.data_add_team = True})
     
            @Html.Partial("_Teams", Model.Contractor)      
        </div>

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 06 Feb 2013 Link to this post

    Hi Alan,

     
    To open the window you just need to call the open method of the window.
    E.g.

    $("*[data-add-team]").click(function () {
        var win = $("#teamWindow").data("kendoWindow");
        win.open().center().toFront();
    })

    I hope this will solve the issue.

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 06 Feb 2013 Link to this post

    I have done so, the ().center().toFront(); should not have been in the example. I have tried with just open it gives the error mentioned in first post
  5. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 06 Feb 2013 Link to this post

    OK solved, I had duplicate scripts in page.
    thanks for your help
Back to Top
UI for ASP.NET MVC is VS 2017 Ready