angular-accordion icon indicating copy to clipboard operation
angular-accordion copied to clipboard

Controlling the accordion programmatically in JavaScript

Open enkemari opened this issue 7 years ago • 6 comments

Hi,

I'd like to control the accordion programmatically with something like:

HTML:

JS: vm.angAccordion.isOpenned = false;

Is there something I'm missing that allows for this already?

enkemari avatar Apr 03 '17 13:04 enkemari

Hi,

Currently there is no way to open/close collapsible items grammatically, you can only specify which collapsible items are open/closed at the time the directive is rendering.

uxxman avatar Apr 03 '17 21:04 uxxman

Ok, thanks. It would be cool to do that, though.

For example, we're using the accordion in a search - we put all our search filters in the accordion and then when the user clicks on the Search button (also in the accordion), we'd like the accordion to close and the table displaying the search results to take up most of the screen. The user can then manually open the accordion again to do a new search.

enkemari avatar Apr 04 '17 08:04 enkemari

you can try for re-render of the directive, but I m not sure I haven't seen angularjs in ages. A good UI design would be to show the search filter accordion on left side and the results table on the right so at each point, user can see what filters are active for the results table

uxxman avatar Apr 05 '17 12:04 uxxman

I need open/close from Javascript controller too. +1

ferchoman09 avatar Oct 04 '17 22:10 ferchoman09

Open/Close from Javascript. +1

tno2007 avatar Feb 05 '18 13:02 tno2007

Open/Close from Javascript. +1

JayPatel1992 avatar Nov 04 '22 21:11 JayPatel1992