Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Last active May 10, 2017 19:26
Show Gist options
  • Save hishaamn/157892283064a0d91aecc34149514b0e to your computer and use it in GitHub Desktop.
Save hishaamn/157892283064a0d91aecc34149514b0e to your computer and use it in GitHub Desktop.
JS - Delete Function
(function (Speak) {
Speak.pageCode(["sitecore", "jquery"], function (sitecore, $) {
return {
initialized: function () {
//set the dialog window visibility here
this.DialogWindow.hide();
},
triggerDelete: function () {
var app = this;
app.Frame.set("sourceUrl", "");
$.ajax({
type: "GET",
dataType: "json",
url: "/api/experimental/itemDeletion",
cache: false,
success: function (data) {
app.Frame.set("sourceUrl", data);
},
error: function () {
console.log("There was an error. Try again please!");
}
});
}
}
});
}) (Sitecore.Speak);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment