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

Kendo Window refresh error

1 Answer 539 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 10 Sep 2014, 02:35 PM
Hi,

I got this window that the second time is called a JavaScript error shows “TypeError: Cannot read property ‘refresh’ is undefined’
 
Please help.

~~~~~~~~~~~~~~~~~~~~ Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@(Html.Kendo().Window().Name("window").Visible(false).Modal(true).Width(1000).Height(700))


<a onclick="verReporte()" class="btn btn-primary">Ver Reporte</a>


function verReporte() {        var precinto = $("#ddlPrecinto").val();
        var unidad = $("#ddlUnidad").val();
        if (unidad == "<Todos>") {           
            unidad = '';        };
       var status = $("#ddlStatus").val(); 
       var category = $("#ddlCategory").val();
       var data = { reportname: "VoterList.trdx", parameters: "Precinto=" + precinto + ",Unidad=" + unidad + ",Status=" + status + ",Category=" + category };
       var myurl = '@Url.Action("ReportViewerGeneric","Report")';        

       var mywindow = $("#window").data("kendoWindow");
       mywindow.refresh({           
                 url: myurl,   
                 data: data       
         });        
        mywindow.title("");       
        mywindow.center();       
        mywindow.open();      
};

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 11 Sep 2014, 07:08 AM
Hi Ricardo,

Generally, there are several possible causes for such a Javascript error:

+ the Window is referenced before the widget is initialized on the page
+ the Window is referenced after the widget has been destroyed
+ a second jQuery instance is registered on the page after the Kendo UI scripts, which deletes all Kendo UI widgets

Judging by the provided information, I would exclude the first option, so please focus on the other two. To begin with, you can debug the script and check whether $("#window") returns the expected DOM element.

In case you need further assistance, please provide a runnable demo.

Regards,
Dimo
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
Ricardo
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or