Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to disable the second and third panels #24

Closed
digish777 opened this issue Sep 25, 2015 · 5 comments
Closed

how to disable the second and third panels #24

digish777 opened this issue Sep 25, 2015 · 5 comments

Comments

@digish777
Copy link

HI,

My situation is like, i have three panels in the accordion, the first panel button triggers the second panel to open and the button inside the second panel triggers third panel to open. i do not want user to open the panel by clicking the plus icon in the right.

Thanks in advance.

@tanmaydesai89
Copy link

Hi @digish777

I am working on same situation. What solutions have you tried so far? I was thinking of preventing default event on click. But $event.preventDefault() not working out for me.

@digish777
Copy link
Author

i gave ng-show property to the v-pane and made sure that, v-pane which is only needed is shown to the user. rest i hided it .

@digish777
Copy link
Author

$scope.showQuestionAccoridon = { ok: false }

LukaszWatroba added a commit that referenced this issue Oct 29, 2015
@LukaszWatroba
Copy link
Owner

Hello!

Now you can disable default click event by adding inactive attribute on v-pane-header element:

<v-accordion>
  <v-pane ng-repeat="pane in panes">
    <v-pane-header inactive>
      {{ ::pane.header }}
      <!-- Your custom toggle button -->
      <button ng-click="$pane.toggle()">Toggle me</button>
    </v-pane-header>

    <v-pane-content>
      {{ ::pane.content }}
    </v-pane-content>
  </v-pane>
</v-accordion>

You can also toggle the pane by id, like so:

<v-accordion multiple control="accordion">

  <v-pane id="{{ pane.id }}" ng-repeat="pane in panes">
    <v-pane-header>
      {{ ::pane.header }}
    </v-pane-header>

    <v-pane-content>
      {{ ::pane.content }}
    </v-pane-content>
  </v-pane>

</v-accordion>

<button ng-click="accordion.toggle(panes[0].id)">Toggle first pane</button>

But first, please download the latest release and... Sorry for the late reply guys!

@Xenovore
Copy link

Is there a way to dynamically set "inactive" on a header? It seems to work fine if I use it like in your example above, but it doesn't work if I try something like:
<v-pane-header inactive="canTogglePane">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants