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

Add autodividers functionality for listviews #2851

Closed
wants to merge 1 commit into from
Closed

Add autodividers functionality for listviews #2851

wants to merge 1 commit into from

Conversation

townxelliot
Copy link
Contributor

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 #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.

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 #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.
@@ -4,7 +4,7 @@
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, my editor has corrected some of the whitespace in this file.

@johnbender
Copy link
Contributor

@townxelliot

Thanks for the pull request. A couple quick notes:

  1. It's best to split up the changeset into multiple commits eg, library changes, tests, doc additions. That way history traversal/viewing/manipulation is easier down the road.
  2. This looks super nice, but this is the kind of thing the we might delegate to a plugin since it's hard to be in the business of knowing all, or even the best subset, of ways in which people will autodivide their listviews. I don't have the final word on this though so the team will have to discuss it.
  3. If we merge this in it'll be post 1.0. So I'm going to close this for now, and I've added it to the top of our listview feature request set.

At a quick glance this does appear useful though and it's built in such a way that people should be able to drop this into their applications pretty easily. Have you considered blogging about this or posting it to the jquery plugins page?

@johnbender johnbender closed this Oct 26, 2011
@townxelliot
Copy link
Contributor Author

On Wed, Oct 26, 2011 at 6:23 PM, John Bender <
reply@reply.github.com>wrote:

At a quick glance this does appear useful though and it's built in such a
way that people should be able to drop this into their applications pretty
easily. Have you considered blogging about this or posting it to the jquery
plugins page?

Thanks for the review, much appreciated.

The issue for me is that I have permission to contribute to jQuery (the
umbrella project) as an Intel employee, but will need to clear new open
source projects I'm maintaining or blogging about.

I'll have a think about the best way forward from here.

Cheers.
Elliot

Reply to this email directly or view it on GitHub:
#2851 (comment)

@toddparker
Copy link
Contributor

Thanks again Elliot. I think this might be worth adding after 1.0 but I wonder if this could be packaged as an extension to listview filter so if you add this script, you get this feature? We're heading int eh direction of keeping widgets simple and using extensions. Filer itself is an extension of listview.

@townxelliot
Copy link
Contributor Author

I have a slightly updated version of this at https://github.com/townxelliot/jquery-mobile/tree/autodividers. This incorporates the tests and docs into the jQuery Mobile ones.

This is also available in the web-ui-fw project I've been working on with colleagues at Intel (which is now open source): https://github.com/web-ui-fw/web-ui-fw. There, autodividers is integrated with our demos, tests and docs.

I'd like to hear whether you're interested in this for core (I can raise a formal pull request), or whether I should just maintain it as part of our project (the project is now more of a series of plugins for jQuery Mobile than it was before, and we've accentuated that angle in the README).

In reply to Todd's comments above, this will work with or without a listview filter, so I think it should be an extension of listview, rather than listview filter. Unless I've misunderstood the question.

@toddparker
Copy link
Contributor

@townxelliot - First off, all the stuff you guys are doing is great and we should coordinate more on what you're doing and how to bring things in or at least package them for easy consumption. Mind shooting me and email at todd [at] filamentgroup.com?

We've actually pulled in a version of the popup script that gabriel posted a while back and are refining it for inclusion, maybe at 1.1.

For the auto-divider, I agree that this would make sense as an extension to listview. If you want to prepare that as a pull request, we can take a look and decide whether now if a good time to pull this in.

@townxelliot
Copy link
Contributor Author

Please see #3302 for the updated pull request, which better separates the changes into different categories.

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.

3 participants