Issue with close event on Kendo UI Window

2 posts, 1 answers
  1. Ale
    Ale avatar
    13 posts
    Member since:
    Dec 2013

    Posted 04 Mar 2014 Link to this post

    Hi everyone,
    this my scenario:

    I have a Kendo UI Window like this: 

    @(Html.Kendo().Window()
        .Name("modalWindow")
        .Modal(true)
        .Draggable(true)
        .Visible(false)
        .Events(ev=>ev.Close("updateDropDownDs"))
        )

    I open this Window with content loaded from partial View with this code:

        function showModalGrid(tableType, tableController, memberName) {

            var modWin = $("#modalWindow").data("kendoWindow");
            $("#modalWindow").kendoWindow(
            {
                content: {
                    url: "/TableEditing/GenericGrid",
                    data: {
                        tableType: tableType,
                        tableController: tableController,
                    }
                },
                modal:true,
            });

            modWin.center();
            modWin.open();
    }


    By the CLOSE event Window call this Method:

        function updateDropDownDs() {

            var targetCombo;
           
            targetCombo= $("#target").data("kendoDropDownList");

            targetCombo.dataSource.read();

        }


    On first time everything work fine, CLOSE event don't fire.
    With debug in chrome i've seen after exiting from updateDropDownDs method I have this error:
    http://localhost:58647/Scripts/kendo/src/js/kendo.colorpicker.js 404 (Not Found)
    I don't understand why I have this error. I don't have any colorpicker in my solution.
    Someone can help me?
    Thanks.




  2. Answer
    Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 06 Mar 2014 Link to this post

    Hello,

    A problem will occur because the window is being initialized again in the showModalGrid function. You should use the refresh method instead to reload the content from a specific URL:
    function showModalGrid(tableType, tableController, memberName) {
        var modWin = $("#modalWindow").data("kendoWindow");
        modWin.refresh({
            url: "/TableEditing/GenericGrid",
            data: {
                tableType: tableType,
                tableController: tableController,
            }
        });
     
        modWin.center();
        modWin.open();
    }



    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top