I have a Custom Tool part on my web part that handles properties. It has a link that when clicked shows up a modal dialog but I'm getting this error:
TypeError: SP.UI.$create_DialogOptions is not a function
this is the code called by the link:
function Initi() {
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = '/_layouts/MyWebPart/ModalDialog.aspx';
dialogOptions.title = "My Web Part";
dialogOptions.width = 660;
dialogOptions.height = 400;
dialogOptions.dialogReturnValueCallback = function (res, retVal) {
if (res === SP.UI.DialogResult.OK) {
ExecuteOrDelayUntilScriptLoaded(function () { RTEActions(retVal) }, "sp.ui.rte.js")
}
};
SP.UI.ModalDialog.showModalDialog(dialogOptions);
return false;
}
It used to work, but I have deleted some web parts from the page and now it's giving this error.