ms-officeoffice-jsoffice-app

Popup window inside a task pane add-in


I have a task pane add-in in Office.

I have an item in the task pane, and a delete button. Now, when users click on the delete button, I want to pop up a small window to ask if users are sure about the deletion. If yes, we continue; if no, we go back to the current page.

It is like the Window confirm() method for a web page.

Does anyone know how to pop up this small window in the task pane add-in?

Additionally, if I want users to choose an option in this popup window (eg, choosing a colour between blue or red) before continuing (let's forget yes or no), how could we realise this? More generally, is it possible to create a custom confirm box?


Solution

  • As you design and build web apps for Office 365 or add-ins for Office and SharePoint, you can take advantage of the Office UI toolkit to make your experience look and feel like Office. The Office UI toolkit has key plug and play components that will make it easy to create web experiences that connect to and integrate with Office.

    One of the controls offered by Office Fabric JS package is Dialog which has a lot of customization. I believe you'll find one suitable for your task.

    Yet another option is to use any UI package which has variety of UI controls, for example jQuery mobile. And finally you may just write your own control.