I'm trying to replace my javascript alert calls with calls to a custom kendo dialog. The difference is that when a javascript alert is called, all javascript execution is suspended until the user clicks ok. With kendo dialogs, execution continues even if the dialog is set to modal. Is there a way to "wait" for the user to click ok before resuming execution of the rest of the javascript? Having the call to the kendo dialog as the last line in the function isn't always an option. Here is the dialog code:
@(Html.Kendo().Dialog()
.Name(
"alertDialog"
)
.Title(
"FastWeigh 10"
)
.HtmlAttributes(
new
{ @class =
"kAlert"
})
.Width(400)
.Modal(
true
)
.Closable(
true
)
.Visible(
false
)
.Actions(actions =>
{
actions.Add().Text(
"OK"
).Primary(
true
);
})
)
And the dialog call itself:
function
kAlert(message) {
var
kDialog = $(
"#alertDialog"
).data(
"kendoDialog"
);
kDialog.content(
"<div class='fwAlert'><span class='fa fa-info-circle'/><p class='alertText'>"
+ message +
"</p></div>"
);
return
kDialog.open().result;
}