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

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

3 Answers 1463 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 05 Feb 2013, 03:36 PM
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>

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 06 Feb 2013, 02:41 PM
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!
0
Alan Mosley
Top achievements
Rank 1
answered on 06 Feb 2013, 02:45 PM
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
0
Alan Mosley
Top achievements
Rank 1
answered on 06 Feb 2013, 03:43 PM
OK solved, I had duplicate scripts in page.
thanks for your help
Tags
Window
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Alan Mosley
Top achievements
Rank 1
Share this question
or