I have a form, in the javascript onSubmit event i make an ajax call to load a kendo window
Js:
function onSubmit(){
var window = $("#window").data("kendoWindow");
window.refresh({
url: url
}).open();
}
View:
@(Html.Kendo().Window() _
.Modal(True) _
.Visible(False) _
.Name("window") _
.Title("Window"))
and this works great, but when I click on a button inside the window and go to the javascript onClick event, if I try to instantiate the window again and access .data("kendoWindow"), I get undefined (not in $("#window")).
function onClickButton(e){
var window = $("#window").data("kendoWindow"); //undefined in .data("kendoWindow")
window.refresh({
url: url
}).open();
}
Don't use the variable named window - this is the name of the global scope.
If this doesn't help, post a full runnable mcve, e.g., in a kendo dojo