Dialog in custom code

Hi, is there a way to use the Dialog box (https://plumsail.com/docs/forms-sp/javascript/dialog.html) also in custom code for form panels (https://plumsail.com/docs/forms-sp/designer/panel.html) before a form is opened?

I like to add a button to a list with custom code which should open a form in a dialog box.

Thank you
Philipp

Dear @phil,

I’m sorry for a late reply, we are working on your issue.

Dear @phil,

We have analyzed your issue. Unfortunately, adding button to a list view can’t be done by Plumsail instruments, but you can build the sharepoint extension: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api

Dear Alex

Thank you for your feedback. Do you see a possibility to integrate your Dialog-API in custom scripts like the pnp, sp, etc. API's are available?

Regards,
Philipp

Dear @phil,

Unfortunately, that’s not possible, the Dialog object is not available in custom code for list views. But you can open the dialog from a panel, as you mention.

Could I clarify, why panels don’t work for you?

Dear Alex

The idea is to have a button (added by JS in custom code) which open a Sharepoint site in a dialog. Currently, the site has to be opened in a new browser tab which is not very handy for the user.

Do you have a good idea how to implement this?

Thank you!

Dear @phil,

Do I understand it right, you have now a configuration when a list items are opened in a new tab? By default, they are opened in the same tab. Do you have any custom code that implements this behavior?

You can also try to turn on “Launch forms in dialog” in List Settings -> Advanced Settings, when the site is in Classic UI mode.

Dear Alex

No, list items will be already opened in a panel.

What we like to do is to place an additional button somewhere on the page (by javascript) to open a new form )from a different list) in a dialog:
image

The problem is, that the standard dialog in Sharepoint is not available anymore. So we like to use your Dialog for this.

Is this understandable? If you have no solution from your side, the need to create a extension for this.

Thank you
Philipp

Dear Philipp,

Unfortunately, that’s not possible to implement with Dialog API, it’s only available on the form.

As a workaround, you can now add a New Form as a web part to any page you want:

https://plumsail.com/docs/forms-sp/how-to/newform-page.html
https://plumsail.com/docs/forms-sp/designer/web-part.html#sharepoint-form

Thank your for your feedback Alex!