New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listview('refresh') does not update the icons of list items #8334

Closed
lukaseckert opened this Issue Nov 24, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@lukaseckert

See
http://jsfiddle.net/us0egzdq/1/

I have a listview and would like to change the icon of one of it's entries after initialization (when the user clicks on it). Although the data-icon attribute of the < li > element is changed by the script, the listview('refresh') command will not update the icon class of the nested < a > element, so the new icon does not become visible.

Tested with jQM 1.4.5

@AHorak

This comment has been minimized.

Show comment
Hide comment
@AHorak

AHorak Jan 27, 2016

Any workaround for that?

AHorak commented Jan 27, 2016

Any workaround for that?

@apsdehal

This comment has been minimized.

Show comment
Hide comment
@apsdehal

apsdehal May 25, 2016

Member

Confirmed, for now you can manually remove ui icon class and add other one for workaround.

Member

apsdehal commented May 25, 2016

Confirmed, for now you can manually remove ui icon class and add other one for workaround.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jun 9, 2016

Contributor
  • Add method updateItems() with optional collection which does sparing refresh() if the collection is not given and restricts itself to the collection if it is given.
  • Change refresh() to agressively update all items and deprecate sparing refresh()
Contributor

gabrielschulhof commented Jun 9, 2016

  • Add method updateItems() with optional collection which does sparing refresh() if the collection is not given and restricts itself to the collection if it is given.
  • Change refresh() to agressively update all items and deprecate sparing refresh()

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 28, 2016

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 29, 2016

Listview: Review refresh() method
  1. Fix signature of public refresh() method

  2. Move sparing _refresh() decision to backcompat

     The decision is delegated to extension points (one for the list item and
     one the anchor(s) it may contain) which are predicates that always return
     true if the backcompat extension is absent, indicating for every item that
     it is to be processed.

     When the backcompat extension is present, the extension points contain the
     class-examining regex-based decision of previous versions.

  3. Add method updateItems()

     In _refresh() we still need to retrieve all list items, even when we get a
     list of items from updateItems(), because the followings require global
     knowledge:

       - Which items have been removed since last time, so we can untrack them

       - Which is the first resp. last item for use with addFirstLastClasses()

Closes gh-8489
Fixes gh-8334

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jul 29, 2016

Listview: Review refresh() method
  1. Fix signature of public refresh() method

  2. Move sparing _refresh() decision to backcompat

     The decision is delegated to extension points (one for the list item and
     one the anchor(s) it may contain) which are predicates that always return
     true if the backcompat extension is absent, indicating for every item that
     it is to be processed.

     When the backcompat extension is present, the extension points contain the
     class-examining regex-based decision of previous versions.

  3. Add method updateItems()

     In _refresh() we still need to retrieve all list items, even when we get a
     list of items from updateItems(), because the followings require global
     knowledge:

       - Which items have been removed since last time, so we can untrack them

       - Which is the first resp. last item for use with addFirstLastClasses()

Closes gh-8489
Fixes gh-8334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment