LukaszWatroba / v-accordion

Multi-level accordion component for AngularJS.
http://lukaszwatroba.github.io/v-accordion
MIT License
310 stars 100 forks source link

nested accordion can't do a collapseall on child accordion from parent accordion onclick #60

Open Jack-Collins opened 8 years ago

Jack-Collins commented 8 years ago
<v-accordion >
            <v-pane ng-repeat="pane in panes">
                <v-pane-header ng-click="accordion.collapseAll()"> {{ ::pane.name }} </v-pane-header> 
                <v-pane-content>
                <!-- nested accordion :) -->
                     <v-accordion control="accordion" ng-if="pane.rules">
                    <v-pane ng-disabled= "loading" ng-repeat="subpane in pane.rules">

                                         ......
                                   ......
                             ......

So I have a nested setup like so and I am trying to basically collapse all subpanes of a child accordion whenever the header of the parent accordion is clicked. It seems that because I have set the control attribute in the child, it is not accessible from the parent to do this collapseAll()

Is there a way around this? Thanks

s5b commented 7 years ago

Not a solution: I have the same conceptual issue with this component. I don't know how to access the accordion control for the children inside the parent accordion either.

In my case I want to be able to open a specific child (and parent) based on the hash URL of the page - to allow deep linking into an FAQ page. This doesn't appear to be possible because I can't seem to get hold of the child accordion controls to affect the changes.

Does anybody know how to do this?