I got following code to showcase a dialogue, however the dialogue wont show up in UI after the First click.
$('#wayneDialog').kendoDialog({
width: '400px',
title: $scope.resourceString.Delete_Confirm_Title+ "'"+ name +"'?",
closable: true,
modal: true,
content: $scope.resourceString.Delete_confirm_Content,
actions: [
{
text: $scope.resourceString.Yes,
action: $scope.onDeleteConfirm,
primary: true
},
{
text: $scope.resourceString.Cancel
}
]
});
I am not sure if I have to do anything extra in this case.
I figured it out. The Kendo Dialog was repeatedly getting initialized in my calling function. Changed the code to initialize Kendo Dialog only once and then updated Title and Dialog before calling Kendo Dialog Open function.
we need to destroy the div and add it again on the close event .
$('#wayneDialog').kendoDialog({
width: '400px',
title: $scope.resourceString.Delete_Confirm_Title+ "'"+ name +"'?",
closable: true,
modal: true,
content: $scope.resourceString.Delete_confirm_Content,
close: function () {
if ($('#wayneDialog').data("kendoDialog")) {
$('#wayneDialog').data("kendoDialog").destroy();
$('<div id="wayneDialog"/>').appendTo('body');
}
return;
}
actions: [
{
text: $scope.resourceString.Yes,
action: $scope.onDeleteConfirm,
primary: true
},
{
text: $scope.resourceString.Cancel
}
]
});
Setting the visible: true option explicitly should do the trick:
$('#wayneDialog').kendoDialog({
visible: true,
width: '400px',
title: $scope.resourceString.Delete_Confirm_Title+ "'"+ name +"'?",
closable: true,
modal: true,
content: $scope.resourceString.Delete_confirm_Content,
actions: [
{
text: $scope.resourceString.Yes,
action: $scope.onDeleteConfirm,
primary: true
},
{
text: $scope.resourceString.Cancel
}
]
});