Accordion : Avoid expansion if cllicking on specific area
Question

Hello, 

I had a question regarding a specific usecase of the accordion. I am using this widget with a listRecord to display a list of tests that will be selected be the users. I wanted to use the accordion to show easily more information about the test selected. 

I want to allow the user to choose between : doing the action quickly (here a selection using buttons) or expanding the item to get more information and decide to choose then. 

Is it possible to change the OnClick property of the accordion to allow only one area clickable ? Or in the contrary, avoid expansion if clicking on a specific area ?


Thank you and have a good day


Solution

Hi,

Attached a simple example.

Regards,

Marcelo

Accordion11.oml

Hi,

Enclose those buttons on a div with this class "noExpand" and than include the below js in a webblock and include that webblock in all the pages that have accordions like those or you can even include the js on the layout.

SyntaxEditor Code Snippet

$('.noExpand').on('click', function(e){
    e.stopPropagation();
});

Regards,

Marcelo

Hi Marcelo, 

Thank you for this quick answer. Unfortunately, I tried it and it is not working. 

I created a web block with this js script included in the javascript popup. I included the block in my screen. I enclosed the buttons in 2 different containers with the same Style Class : noExpand and it is not working ...

I am also facing another issue with the accordion : When I click on a button, I have a screen action updating my data base and then refreshing the data source and ajax refreshing my widget. 

If as widget refreshed I select the if with the buttons, it does not refresh the buttons but the database yes and I can still use the accordion. If I select the list record, then I cannot expand the accordion anymore but the buttons are refreshed

Best regards

Solution

Hi,

Attached a simple example.

Regards,

Marcelo

Accordion11.oml

Hi Marcelo, 

Thank you very much for your help

I am closing the topic. Have a good day

Best regards

Guillaume

Hi everyone,

It's work, but in my case, I have 4 Accordions and it just effect on the first accordion! And I dont know how to resolve :(

What should I do to resolve my problem? :(

Best Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.