Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Added an autodivide option to Listview #2466

Closed
wants to merge 2 commits into from
Closed

Added an autodivide option to Listview #2466

wants to merge 2 commits into from

Conversation

skyronic
Copy link

Autodivide will automatically insert list dividers whenever the first letter
of the text that's inside the list item changes.

It can be used to re-create the functionality of the list divider experiment without
actually having to add the dividers manually.

Autodivide will automatically insert list dividers whenever the first letter
of the text that's inside the list item changes.

It can be used to re-create the functionality of the list divider experiment without
actually having to add the dividers manually.
@skyronic
Copy link
Author

Please note that this can be activated by setting data-autodivide="true" in the <ul> element.

@toddparker
Copy link
Contributor

This is a cool feature, thanks for submitting. I think we're going to pull this in, but after 1.0. Thanks!

@staabm
Copy link
Contributor

staabm commented Sep 20, 2011

Would be cool when the "active" divider will not be scrolled out of the view but stay sticky at the top of the list (like the native lists on iOS)

@skyronic
Copy link
Author

@staabm - There's already a functionality for making the "active" divider not get scrolled out. It's there in experimental:

https://github.com/jquery/jquery-mobile/blob/master/experiments/scrollview/lists-divider.html

@scottjehl
Copy link

added to the feature requests wiki. Thanks! https://github.com/jquery/jquery-mobile/wiki/Feature-Requests

@scottjehl scottjehl closed this Sep 21, 2011
npmcomponent pushed a commit to npmcomponent/cbou-jquery-mobile that referenced this pull request Jan 8, 2014
Can be used to autogenerate dividers for a listview by
setting data-autodividers="alpha" (dividers are unique,
uppercased single characters from list items) or
data-autodividers="full" (unique full text strings selected
from list items) on the ul element of the listview.

It's also possible to apply a custom selector to find the
elements to be used for divider text, with
data-autodividers-selector="...".

This relates to jquery-archive/jquery-mobile#2466,
but is a different implementation which will automatically
update the list dividers if the list elements change. It also
has a fairly thorough test suite and documentation.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants