|
. . .
@Html.EJS().Dialog("ajax_dialog").Close("dialogClose").Created("created").Open("dialogOpen").Header("Dialog content is loaded using AJAX").ShowCloseIcon(true).CloseOnEscape(true).Width("500px").Target("#target").Render()
. ..
<script>
. . .
function dialogOpen() {
var spinnerTarget = document.getElementById('ajax_dialog')
//createSpinner() method creates the spinner
ej.popups.createSpinner({
target: spinnerTarget
});
//showSpinner() method will show the spinner
ej.popups.showSpinner(spinnerTarget);
//Time Interval is set here for demo purpose to check the spinner visibility.
setInterval(function () {
var ajax = new ej.base.Ajax('https://localhost:44374/Content/Dialog/ajaxcontent.html', 'GET', true);
ajax.send().then();
ajax.onSuccess = function (data) {
dialogObj.content = data;
};
//hideSpinner() method will hide the spinner
ej.popups.hideSpinner(spinnerTarget);
}, 5000);
}
. . .
</script> |