Office ui fabric panel won't close

2019-08-20 16:40发布

问题:

I use an Office UI Fabric Panel (nothing special, just as in the Microsoft examples). However, I want to trigger the panel programmatically. I open the panel lik this:

 $("#btnOpenPanel").trigger( "click" );

In the panel I have a form. When I submit the form I do an update in the database and close the form. The database update works fine and I want to close the panel the same way I opened it. So like this again:

 $("#btnOpenAddPanel").trigger( "click" );

But that is not working. The panel remains open.

Is there some other way to close the panel?

回答1:

I found the solution.

Using: panelInstance.dismiss(); closes the panel.