How to programmatically expand or collapse an Oracle JET ojCollapsible

1.1k Views Asked by At

I am using Oracle Jet and I have this dialog where I show a "More Options" section using an ojCollapsible that is supposed to always show up collapsed when the dialog initially shows up.

When the dialog is closed and brought back, I need the ojCollapsible to show up closed again. How can I programmatically tell it to collapse?

1

There are 1 best solutions below

2
Marcelo On

This is the way to do it:

$(".selector").ojCollapsible( { "expanded": false} );

Use true if what you want is to have it expanded.

This turned out to be pretty simple and kind of obvious in retrospective, however, each time I spend some time without doing it I find myself in the same situation wondering how to do it and the cookbook doesn't include an example.