For some reason, my SharePoint's modal dialog doesn't work properly. The error I get is this:
- In Firefox:
SP.UI.$create_DialogOptions is not a function
- In IE:
Object doesn't support this property or method
Here is my code:
var options = SP.UI.$create_DialogOptions();
options.width = 525;
options.height = 300;
options.url = '/_layouts/mywork/richtexteditor.aspx';
options.dialogReturnValueCallback = Function.createDelegate(null, function (result, value)
{
alert(result + value);
});
SP.UI.ModalDialog.showModalDialog(options);
Interestingly, when I inspect the SP.UI in Firebug, I don't see all the methods and properties.
NOTE: I am using standard Webpart (not visual) and not an application page.
SP.UI.$create_DialogOptions
is not loaded yet. SP2010 created a new mess with this "dynamic" JS stuff. – Vespuccivar options = {...}
, although this will just delay the error to theshowModalDialog
line. I'm not sure why$create_DialogOptions
ever became so widely suggested... – Vespuccivar options = {...}
before... then it broke on:SP.UI.ModalDialog.showModalDialog(options);
– Tympanites