Garrett
Posts: 0
Joined: Sat Aug 17, 2013 12:18 pm

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

I have a collapsible set that is dynamically populated with the results of a service.

I have a button that is outside of the collapsible set.

I would like to expand a certain collapsible block when the button is clicked.

The targeted collapsible block is based on it's position in the set (for example... I may want to expand the second block down).

I need to be able to do this with JavaScript.

codeAppery('mobilecollapsblock', this).trigger('expand');/code This code by itself won't cut it since the button calling it does not fall inside the block or set.

Any easy way to get the id of a dynamic block based on its index or something like that?

Code samples/examples are much appreciated!

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

Hello,

You could use your code on mobilecollapsibleset click event. It will expand mobilecollapsblock when you click on it,

Garrett
Posts: 0
Joined: Sat Aug 17, 2013 12:18 pm

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

I don't want to click on it; I want it to be called by a separate button. This is fairly important for the functionality of the app.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

Hello! On button click run the following code:
preAppery("mobilecollapsblock_9").trigger('expand');/pre
where mobilecollapsblock_9 - name of mobilecollapsblock, not entire mobilecollapsibleset, but specific mobilecollapsblock

Garrett
Posts: 0
Joined: Sat Aug 17, 2013 12:18 pm

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

The problem is that the collapsibleset is generated from service results and may have 1 block or 1000 blocks.

I ended up using the code you just posted as a reply on the other thread...

[quote:]
codeAppery("mobilecollapsibleset_2").find("[data-role=collapsible]").not("[_tmpl=true]").eq(2).trigger('expand');/code

mobilecollapsibleset_2 - name of entire mobilecollapsibleset
eq(2) - select third element, counting starting 0
[/quote]

Garrett
Posts: 0
Joined: Sat Aug 17, 2013 12:18 pm

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

I agree. I appreciate everyone's help! You guys are very good about responding quickly.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Expanding collapsible set block with a button outside of the collapsible set. Collapsible set is dynamically generated w

Hello!

Please clarify do you want to collapse collapsible block or call events added on collapse event?

Return to “Issues”