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

Issue with close event on Kendo UI Window

1 Answer 99 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ale
Top achievements
Rank 1
Ale asked on 04 Mar 2014, 04:54 PM
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.




1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 06 Mar 2014, 09:49 AM
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!
Tags
Window
Asked by
Ale
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or