Skip to main content
added 21 characters in body
Source Link
C. Hoffmann
  • 625
  • 2
  • 6
  • 20

I've created a SHP 2013 appSharepoint-Hosted App on visual studio, on.

On my App.js that's created by default, i have the following lines to show a Modal Dialog

var options = { url: 'http://www.google.com', width: 400, height: 300 };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);

It works as intended, the little dialog is shown correctly.

After that, i've created a new Client Web Part (App Part) on visual studio, and on the aspx file for my app part i have the same JS lines

<script type="text/javascript">
    var options = { url: 'http://www.google.com', width: 400, height: 300 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
</script>

But this time it returns an error saying the reference to the property 'execute' is null or undefined.

Is it possible to invoke a modal window from within a App Part? What changes from invoking it from the Default page of my app?

Thanks in advance.

I've created a SHP 2013 app on visual studio, on my App.js that's created by default, i have the following lines to show a Modal Dialog

var options = { url: 'http://www.google.com', width: 400, height: 300 };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);

It works as intended, the little dialog is shown correctly.

After that, i've created a new Client Web Part (App Part) on visual studio, and on the aspx file for my app part i have the same JS lines

<script type="text/javascript">
    var options = { url: 'http://www.google.com', width: 400, height: 300 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
</script>

But this time it returns an error saying the reference to the property 'execute' is null or undefined.

Is it possible to invoke a modal window from within a App Part? What changes from invoking it from the Default page of my app?

Thanks in advance.

I've created a SHP 2013 Sharepoint-Hosted App on visual studio.

On my App.js that's created by default, i have the following lines to show a Modal Dialog

var options = { url: 'http://www.google.com', width: 400, height: 300 };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);

It works as intended, the little dialog is shown correctly.

After that, i've created a new Client Web Part (App Part) on visual studio, and on the aspx file for my app part i have the same JS lines

<script type="text/javascript">
    var options = { url: 'http://www.google.com', width: 400, height: 300 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
</script>

But this time it returns an error saying the reference to the property 'execute' is null or undefined.

Is it possible to invoke a modal window from within a App Part? What changes from invoking it from the Default page of my app?

Thanks in advance.

Source Link
C. Hoffmann
  • 625
  • 2
  • 6
  • 20

SharePoint 2013 App Part and Modal Dialogs

I've created a SHP 2013 app on visual studio, on my App.js that's created by default, i have the following lines to show a Modal Dialog

var options = { url: 'http://www.google.com', width: 400, height: 300 };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);

It works as intended, the little dialog is shown correctly.

After that, i've created a new Client Web Part (App Part) on visual studio, and on the aspx file for my app part i have the same JS lines

<script type="text/javascript">
    var options = { url: 'http://www.google.com', width: 400, height: 300 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
</script>

But this time it returns an error saying the reference to the property 'execute' is null or undefined.

Is it possible to invoke a modal window from within a App Part? What changes from invoking it from the Default page of my app?

Thanks in advance.