Last active
May 10, 2017 19:26
-
-
Save hishaamn/157892283064a0d91aecc34149514b0e to your computer and use it in GitHub Desktop.
JS - Delete Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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