Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

This event is not firing. Can you help?

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Event not firing

Hi Aeneas,

We are sorry, this is a bug. Collapse and Expand events don't work.

Here is a workaround.

Collapse: preApperyio("mobilecollapsblockName").on( "collapsiblecollapse", function( event, ui ) {
//your code here
} );/pre

Expand: preApperyio("mobilecollapsblockName").on( "collapsibleexpand", function( event, ui ) {
//your code here
} );/pre
Where mobilecollapsblockName is a name of collapsible block.

Lucas Cranach
Posts: 0
Joined: Fri Jun 13, 2014 2:16 am

Event not firing

Thanks for that but where do I put this code? In the on expand event?

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Event not firing

Hello Lucas!

You can find more information here: https://getsatisfaction.com/apperyio/...

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Thanks for response. The event is now working but I want to reference a label within that collapsible that I expanded but am again getting all the results of all collapsible labels. I've tried...

alert($(this).parent().find("[name=lblMsgRead]").text());
alert($(this).find("[name=lblMsgRead]").text());

The event is passing UI to it - function( event, ui )

How do I use this to reference just the current lblMsgRead item?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Hi Aeneas.

Please use this code for your needs:

pre

Apperyio("mobilecollapsblockName").on( "collapsiblecollapse", function( event, ui ) {
var currentElement = jQuery(event.target);
alert(currentElement.find("[name=lblMsgRead]").text());
} );

/pre

Also if you want to understand why your code not worked please follow this document: http://javascript.info/tutorial/bubbl...

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Thanks for your help that works well. I am quite new to Java so will read through the tutorial.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Hi for some reason this has stopped working now. I have a collapsible (collapsemessagedetail ) inside another collapsible(collapseMessages ) that I want to trigger even on.

My breadcrumbs read as:
Main / panelMessages / collapseMessages / collapsmsgblockcontent / collapsemessagedetail

If I have add these 2 events

Apperyio("collapseMessages").on( "collapsibleexpand", function( event, ui ) {

alert('Expand1');

} );

Apperyio("collapsemessagedetail").on( "collapsibleexpand", function( event, ui ) {

alert('Expand2');

} );

Only the first event triggers when I click on parent and child so I'm always seeing "Expand1" in alert. How do I get other one to work?

Thanks,
Aeneas

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Event not firing

Hi Aeneas

In this case you should use following code:

pre

//Note you should replace "mobilecollapsblock_25" with your first level collapsible.
Apperyio("mobilecollapsblock_25").bind( "collapsibleexpand", function( event, ui ) {

alert('Expand1');
event.stopPropagation();

} );

//Note you should replace "mobilecollapsblock_28" with your second level collapsible.
Apperyio("mobilecollapsblock_28").bind( "collapsibleexpand", function( event, ui ) {

alert('Expand2');
event.stopPropagation();

} );

/pre

Also please double check mobilecollapsible component names. I guess you have mistaken with these names.

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Event not firing

Hi Yuri,

Using your CurrentElement technique I was able to return the value of the label inside a collapsible however the same technique won't return the label of the collapsible header.

alert(currentElement.find("[name=lblMsgRead]").text());
Returns "true" - correct

alert(currentElement.find("[name=lblMsgHdr]").text());
Returns (blank) - should return "Message From Lucas"

Image

Return to “Issues”