-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add attribute to auto-expand a collapsible in a set #4697
Comments
Actually it is already possible to programmatically expand / collapse a collapsible. I created a sample: http://jsbin.com/umajup/5/ We will add examples like this to the docs with the code how to achieve it. With possibilities to add |
Thanks for the tip ! I'll try this piece of code, even though clicking the buttons on the two pages you linked to does not do anything on Chrome / Win. I didn't know there were a collapse/expand events I could trigger because there is nothing in the documentation about those. The data-attribute had the advantage of being processed on page build though. |
Very strange, I just tested on Chrome/Win and all buttons work. To be honest, I didn't know it was possible to trigger "expand" / "collapse" events either until I looked at the code because of this ticket. So, yes, we do need to add this to the docs (see #4389). I updated the code a little bit (http://jsbin.com/umajup/7/edit#html), because setting |
I think it's because you included a script from "localhos" on the jsbin page ;) Thanks for the tip about the events though, I was using a trigger('click') on the '.ui-btn' child element of the collapsible (but also works triggering click on the collapsible itself obviously because of propagation. |
Aiii... I grabbed a JSBin I used for something else and forgot I loaded script from localhost for that. Sorry! |
np, shit happens :) thanks ! |
Along with the collapsible sets and data-collapsed attribute, it would be nice to add another attribute along the lines of
so the first / last / nth collapsible would automatically be expanded on intialization.
Sometimes the collapsibles' HTML can be generated so it may not be known which one should have the data-collapsed="false" attribute at that time.
With the collapsible also lacking a programmatic way of expanding / collapsing its contents for now (there is already another feature request for this), it is kind of problematic as it is now (v1.1.1)
The text was updated successfully, but these errors were encountered: