admin管理员组文章数量:1357112
Using KendoUI to display a popup window, I've noticed that if I reuse an existing window by calling refresh
it briefly displays the old content until the AJAX request pletes.
My code:
function clickHandler(evt) {
evt.preventDefault();
var dta=this.dataItem($(evt.currentTarget).closest("tr"));
convertWindow.refresh({ type: "GET", url: "CallMeConvert?AppointmentId="+dta.AppointmentId});
convertWindow.center();
convertWindow.open();
}
Is there any way to prevent this happening, or must I destroy and recreate the window every time?
Using KendoUI to display a popup window, I've noticed that if I reuse an existing window by calling refresh
it briefly displays the old content until the AJAX request pletes.
My code:
function clickHandler(evt) {
evt.preventDefault();
var dta=this.dataItem($(evt.currentTarget).closest("tr"));
convertWindow.refresh({ type: "GET", url: "CallMeConvert?AppointmentId="+dta.AppointmentId});
convertWindow.center();
convertWindow.open();
}
Is there any way to prevent this happening, or must I destroy and recreate the window every time?
Share Improve this question edited Oct 4, 2013 at 1:36 Manic Coder asked Oct 4, 2013 at 1:06 Manic CoderManic Coder 1331 silver badge7 bronze badges2 Answers
Reset to default 8It was, in the end, quite simple. You just need to clear the HTML immediately before doing the reset, like so:
$("#convert-window").html("");
convertWindow.refresh({ type:"GET", url:url }).center().open();
Try opening the window not when you start the refresh but when it finishes. What you need to do is use the refresh
event:
function clickHandler(evt) {
evt.preventDefault();
var dta=this.dataItem($(evt.currentTarget).closest("tr"));
converWindow.bind("refresh", function() {
convertWindow.center().open();
});
convertWindow.refresh({ type: "GET", url: "CallMeConvert?AppointmentId="+dta.AppointmentId});
}
NOTE You actually don't need to bind
refresh
event every time, you can define it during the Window initialization.
var convertWindow = $("#my_window").kendoWindow({
...
refresh : function () {
convertWindow.center().open();
}
});
本文标签: javascriptKendoUI Window Flashes Old ContentStack Overflow
版权声明:本文标题:javascript - KendoUI Window Flashes Old Content - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744030671a2578849.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论