Bootstrap Collapse depending on value

Asked

Viewed 69 times

3

I have a table, with some lines "collapsed" and all checkbox, for selection. I’m using the data-toggle="Collapse", but it’s not helping me very well.

What I need is:

  • Click on the "Select All" checkbox, open all "collapsed" lines and select all checkboxes;
  • Click on the Client checkbox (the line that uses Collapse), open the "collapsed" lines of this client and select the checkbox of these lines;
  • Select all line checkboxes within a client, select the client checkbox
  • Take the 1 checkbox selection from the lines within a client, uncheck the client checkbox, if checked

The part of selecting the checkbox I did quiet, but I’m picking for Collapse, because select the checkbox, trigga the Collapse and it gets lost all by changing the icon and "collapse" the lines.

Is there a simple way to "open/close" the Shoulder? Or is it easier to "create" the Shoulder from scratch and not use the bootstrap?

inserir a descrição da imagem aqui

1 answer

1

I managed to solve it! Bootstrap has some methods that show or hide Collapse:

.collapse('show/hide/toggle')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.