'Office ui fabric panel won't close

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?



Solution 1:[1]

I found the solution.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hacking_mike