collapsing a section

Posted by otenzio on 04-Nov-2014 06:15

Hi,


I have a section named "Test" that has Collapsible on true and style "Title & Rounded Border".

On load event of the page i wrote the following javascript:

var sectionID = rbf_getSectionIdByTitle("test");
rbf_setSectionCollapse(sectionID, true);

But it doesn't collapse.

Also i want to expand it on click.

Can anyone help me with this?

Thanks!

All Replies

Posted by matman on 04-Nov-2014 06:22

Hi Otenzio,

please try the following code:

$(function() {
	var sectionID = rbf_getSectionIdByTitle("test");
	rbf_setSectionCollapse(sectionID, true);
});

Your current code is executed as soon as possible, which means that the section you try to collapse probably doesn't exist yet. The code above is a JQuery function, this one will run after the page (and your section) have been loaded.

Posted by otenzio on 04-Nov-2014 06:32

It doesn't work... i think it has something to do with the style. If i select at style only "Title Bar" is collapsed.

But then how can i expand it?

Posted by matman on 04-Nov-2014 06:39

It should be collapsible if "collapsible" is checked and the style is "Title & Rounded border". Try to put your script component inside a seperate section and put that section on top of every other section. You should also be able to collapse and uncollapse the section on the page where the section is shown.

Posted by Orchid Corpin on 04-Nov-2014 07:53

Hi,

I also tried the above code in both "Title & Rounded Border" and "Title bar" and it was working fine.
Can you check if you have errors in the page? Press (F12) for chrome.

Regards,
Orchid

Posted by Orchid Corpin on 11-Nov-2014 09:54
Hi otenzio,

Just checking if your issue has been fixed? Or do you have any questions related to this?
Thank you.

Regards,
Orchid
This thread is closed