Page 1 of 1

Why can't I invoke a service when a user clicks on the Collapse Block Header?

Posted: Wed Jul 08, 2015 3:20 pm
by Shaun Summers

I would like to load a selection list for a field that is in a Collapsable Block but only if the user clicks the block header to open it up.

I can use the other elements of the collapsable block for an on click event (the body, content, ...) but not the header. The problem with using the other elements is that the event is triggered everytime the user clicks on a field in the expanded area.

Any ideas?

Regards, Shaun.


Why can't I invoke a service when a user clicks on the Collapse Block Header?

Posted: Thu Jul 09, 2015 5:46 am
by Pavel Zarudniy

Hi Shaun,
Please try to use following construction:
code
Apperyio("<mobilecollapsblock>")&#46;closest('[data-role="collapsible"]')&#46;find('h3')&#46;click(
function(){
&#46;&#46;
}
);
/code


Why can't I invoke a service when a user clicks on the Collapse Block Header?

Posted: Thu Jul 09, 2015 7:43 am
by Shaun Summers

Thank you. Where/when should I execute the javascript (on page load?)

Regards, Shaun.


Why can't I invoke a service when a user clicks on the Collapse Block Header?

Posted: Thu Jul 09, 2015 8:09 am
by Shaun Summers

I have tried running the javascript on page load:

Apperyio("").closest('[data-role="collapsible"]').find('h3').click(list_countries.execute({}));

But it seems to execute the service regardless of whether the header is clicked. What am I doing wrong?


Why can't I invoke a service when a user clicks on the Collapse Block Header?

Posted: Sun Jul 19, 2015 9:43 am
by Alena Prykhodko

Add it on Click event for Collapsible Block