I love the concept of the accordion, but I’ve found it a bit limiting in practice. Some of the things I’d like to see implemented in the future:
*add an Event for when a specific section is expanded. I’ve not figured out a way to trigger a behavior ONLY when a certain section is clicked; all I can gather is that I can trigger behaviors when ANY section is clicked.
*treat section headers as containers too. I’d like to be able to dynamically add/remove/change elements from the section headers, other than the icon.
*allow the section icon to be removed once added. is this a bug?
*add an action to operate on the accordion to expand a certain section.
If these were added, this would be an even better mutli-purpose expandable container.
Since Event can not carry any parameter, so you can only handle the event for any section is expanded/collapsed. However you could check which section is expanded by checking the “Section Expanded Flags” property. Here is the introduction of the property: http://www.foreui.com/doc/html/sectio…, and here is an example of the usage: http://www.foreui.net/node/88.
If you are using accordion in single expansion mode, you can check the “First Expanded Section” property as well. Introduction here: http://www.foreui.com/doc/html/indexo…
To remove the icon in header, just double click the accordion and enter the editing state, removing the [imgxxx] prefix of title will remove the icon as well.
As for header container and “Expand Section” action, we will consider them in future update. Thanks for the suggestions.
I did try the “Section Expanded Flags” property, but it’s not quite enough for me. I’m doing multiple expansion mode, and if I, for example, expand the first section, I can trigger an action. Then say I want to expand the third section, but I don’t want to trigger that action again. If I use “Section Expanded Flags”, the flag for the first section will still be set (I haven’t closed it yet), so it will trigger the action again. There’s no way to access only the *latest* section expansion.
Thanks for the tip on removing the icon, maybe it could be incorporated into the GUI properties too?
As always, thanks for the great product and quick reply. You are first-class, all the way.
Could there be some kind of property that described the Latest Section Expanded? so, if I open the sections like this: 1,3,4,2 — the current value would be “2”. That would help me get there…
“Latest Expanded Section” seems to be a good property to add, thanks for the idea
Hi pohldoug, we have added the “Recent Expanded Section” and “Recent Collapsed Section” properties for Accordion element in V2.80.
This question is now closed