How to display a popup dialog to open a list/library?
Last Update: June 22, 2018
Here are the steps on how to display a popup dialog to open a SharePoint list/library when click on a Button control in the form.
- Open the form in
design mode.
- Add the following controls in the form as follows:
- Select the Button control.
- In the
Rules pane, click on the Add icon to add a new rule, the
Rule Manager dialog will open.
- Add a new rule as follows:
A. Change the
Rule Name as desired.
B. Change the
Rule Type to Action.
C. Change the
Event Type to onClick.
D. In the
Actionsection, type the following script:
var options = { url: getWebServerRelativeURL() + '/intranet/Lists/Countries/NewForm.aspx?RootFolder=1', title: 'Countries', allowMaximize:true, showClose: true, width: 700, height: 350 };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
setValue(txtItemNo, getRepeaterRow(repeater3))
E. Click on the
Save button to save the rule.
Note: You can use
Assistance Panel to help you adding functions and related parameters, form variables and form controls to
Conditions and/or
Actions sections. - Test the form by clicking on the
Preview button in the
View group.
Related Resources:
These resources may not reflect the same exact case steps.
https://www.youtube.com/embed/nzyJejxNJUI