uxxman / angular-accordion

A simple angular directive for adding accordion UI element
MIT License
54 stars 37 forks source link

Controlling the accordion programmatically in JavaScript #29

Open enkemari opened 7 years ago

enkemari commented 7 years ago

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?
uxxman commented 7 years ago

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.

enkemari commented 7 years ago

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.

uxxman commented 7 years ago

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

ferchoman09 commented 6 years ago

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

tno2007 commented 6 years ago

Open/Close from Javascript. +1

JayPatel1992 commented 1 year ago

Open/Close from Javascript. +1