Hi,
Great day.
Just would like to seek help in adding confirmation dialog to my upload
window. I added confirm dialog on select event but I did not know to
implement it properly. All I want is when the user select yes, the
upload event proceed but if the user select "No", the the confirm dialog
will close and the main kendow will close also..
Here's my code:
$(document).ready(function () {
var lookup = $("#ComboLookupTable").data("kendoComboBox");
$("#get").click(function () {
});
$("#files").kendoUpload({
async: {
saveUrl: "UploadFile/Lookup",
autoUpload: false,
value: 'Import'
},
multiple: false,
progress: function (e) {
},
select: function (e) {
debugger;
var kendoWindow2 = $("<div />").kendoWindow({
title: "Replace Lookup Table Data?",
resizable: false,
modal: true
});
kendoWindow2.data("kendoWindow")
.content($("#delete-confirmation").html())
.center().open();
kendoWindow2
.find(".delete-confirm,.delete-cancel")
.click(function () {
if ($(this).hasClass("delete-cancel")) {
debugger;
//e.preventDefault();
e.close();
kendoWindow2.data("kendoWindow").close();
//return;
}
else {
debugger;
kendoWindow2.data("kendoWindow").close();
}
})
// .end()
},
localization: {
select: "Select a file",
uploadSelectedFiles: "Import",
remove: "Remove"
},
upload: function (e) {
debugger;
e.data = { additional: $("#ComboLookupTable").val() };
debugger;
}
//upload: onUpload
//select: onSelect
});
});
<script id="delete-confirmation" type="text/x-kendo-template">
<p class="delete-message">This will replace all of the existing data for lookup table</p>
<p></p>
<p> Are you sure?</p>
<button class="delete-confirm k-button">Yes</button>
<button class="delete-cancel k-button">No</button>
</script>
I hope you could help me on this. Thank you in advance. God bless