You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shortcoming / missing feature
Accordion and file explorer are two particular cases of lists: the first puts an emphasis on other elements closing when one is opened, the second on (possibly deeply) nested lists with a clear visual indication of whether an element is or can be expanded. Both have many use cases and are very useful in a number of applications, but Onsen UI does not currently support either out of the box, therefore requiring custom code that is in my opinion just boilerplate. I believe a programmer nowadays can expect this functionality to be provided by a library, and not having to code a pretty standard component.
Feature request
Creation of a new component, or addition of an attribute that specifies what else should happen when an expandable is actioned. It should be possible to choose between different behaviours towards same-level or child expandables.
Easy way to have customizable symbols such as +/- toggle on item expansion/collapse. It should be possible to place the symbol anywhere within the list-item, regardless of div.left, div.center or div.right. This should not break with nested lists: currently the wrong chevron is shown in sub-lists.
Sample code
In order to illustrate the desired behaviour, I'm posting a snippet of how I added this functionality.
To see it work, you'll have to paste this elsewhere: unfortunately the playground does not allow saving and sharing a link.
<ons-list-itemexpandableclass="list-item level-0"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Russians</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Lev Nikolayevich Tolstoy</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Anna Karenina</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">War and Peace</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Resurrection</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Fyodor Mikhailovich Dostoevsky</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Crime and Punishment</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">The Idiot</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">The Brothers Karamazov</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Alexander Sergeyevich Pushkin</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Eugene Onegin</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Boris Godunov</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">The Stone Guest</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-0"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">French</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Honoré de Balzac</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Lost Illusions</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Le Père Goriot</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Splendors and Miseries of Courtesans</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Jules Verne</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Michael Strogoff</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Journey to the Center of the Earth</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Twenty Thousand Leagues under the Seas</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Victor Hugo</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Les Misérables</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Le roi s'amuse</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Notre-Dame de Paris</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-0"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">English</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Mark Twain</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">The prince and the Pauper</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">The Adventures of Tom Sawyer</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">A Connecticut Yankee in King Arthur's Court</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">William Shakespeare</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Hamlet</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Romeo and Juliet</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Titus Andronicus</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item><ons-list-itemexpandableclass="list-item level-1"><divclass="left"><ons-iconicon="md-plus"></ons-icon></div><divclass="center">Jane Austen</div><divclass="right"></div><divclass="expandable-content"><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Sense and Sensibility</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Pride and Prejudice</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item><ons-list-itemtappableclass="list-item level-2"><divclass="left"></div><divclass="center">Emma</div><divclass="right"><ons-iconicon="md-forward"></ons-icon></div></ons-list-item></div></ons-list-item></div></ons-list-item>
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
Environment
Onsen UI Version: onsenui v2.10.10 - 2019-07-29
Platform: Cordova 9.0.0 -> Android, Browser
Shortcoming / missing feature
Accordion and file explorer are two particular cases of lists: the first puts an emphasis on other elements closing when one is opened, the second on (possibly deeply) nested lists with a clear visual indication of whether an element is or can be expanded. Both have many use cases and are very useful in a number of applications, but Onsen UI does not currently support either out of the box, therefore requiring custom code that is in my opinion just boilerplate. I believe a programmer nowadays can expect this functionality to be provided by a library, and not having to code a pretty standard component.
Feature request
Creation of a new component, or addition of an attribute that specifies what else should happen when an expandable is actioned. It should be possible to choose between different behaviours towards same-level or child expandables.
Easy way to have customizable symbols such as +/- toggle on item expansion/collapse. It should be possible to place the symbol anywhere within the list-item, regardless of div.left, div.center or div.right. This should not break with nested lists: currently the wrong chevron is shown in sub-lists.
Sample code
In order to illustrate the desired behaviour, I'm posting a snippet of how I added this functionality.
To see it work, you'll have to paste this elsewhere: unfortunately the playground does not allow saving and sharing a link.
Non-working demo link
The text was updated successfully, but these errors were encountered: