Page 1 of 3

Event not firing

Posted: Tue Jun 24, 2014 7:46 am
by Aeneas McBurney

This event is not firing. Can you help?

Image


Event not firing

Posted: Tue Jun 24, 2014 9:27 am
by Kateryna Grynko

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.


Event not firing

Posted: Tue Jun 24, 2014 8:33 pm
by Lucas Cranach

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


Event not firing

Posted: Tue Jun 24, 2014 9:53 pm
by obullei

Hello Lucas!

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


Event not firing

Posted: Tue Jun 24, 2014 10:27 pm
by Aeneas McBurney

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?


Event not firing

Posted: Wed Jun 25, 2014 12:05 am
by Yurii Orishchuk

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.


Event not firing

Posted: Wed Jun 25, 2014 12:23 am
by Aeneas McBurney

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


Event not firing

Posted: Wed Jun 25, 2014 4:27 am
by Aeneas McBurney

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


Event not firing

Posted: Wed Jun 25, 2014 4:55 am
by Yurii Orishchuk

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.


Event not firing

Posted: Wed Jun 25, 2014 10:11 pm
by Aeneas McBurney

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