Shaun Summers
Posts: 0
Joined: Thu Jul 25, 2013 3:49 pm

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

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.

Pavel Zarudniy
Posts: 0
Joined: Mon Jul 06, 2015 8:56 am

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

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

Shaun Summers
Posts: 0
Joined: Thu Jul 25, 2013 3:49 pm

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

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

Regards, Shaun.

Shaun Summers
Posts: 0
Joined: Thu Jul 25, 2013 3:49 pm

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

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?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

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

Add it on Click event for Collapsible Block

Return to “Issues”