Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KendoUI Window Flashes Old Content

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 completes.

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?

like image 743
Manic Coder Avatar asked Feb 16 '23 02:02

Manic Coder


1 Answers

It 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();
like image 67
Manic Coder Avatar answered Feb 24 '23 00:02

Manic Coder