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

listview('refresh') does not update data-icon #3035

Closed
@offsky

Description

@offsky

If you use javascript to change the icon for a listview row, there is no way to refresh the list to cause the new icon to take effect. Calling listview('refresh') will not update the data-icon.

Example:
http://jsfiddle.net/HyL9n/2/

The example will show that listview('refresh') will work to add a new row, and it will work to update the count bubble, but it will not work to change the icon.

Activity

toddparker

toddparker commented on Nov 14, 2011

@toddparker
Contributor

At the moment, I believe refresh only enhances new nodes, it doesn't re-parse the already enhanced nodes because that would be too heavy. If you wanted to have the framework re-load a node if you changed something about it, just remove the LI and replace it with a new one and call refresh.

offsky

offsky commented on Nov 14, 2011

@offsky
Author

Well, some parts of the existing enhanced node is being refreshed because I can add/remove a count bubble and it gets re-enhanced when I call listview('refresh'). It just appears to be the icon that can't change.

Can I suggest that we make a more elegant solution than destroying and recreating a row? Maybe .listrow('refresh') that we could call on an individual row to refresh it? Or, even better would be a general purpose refresh function that we could call on any collection of nodes to cause them all to get re-enhanced. Something like $('.needs-refresh').refresh();

toddparker

toddparker commented on Nov 14, 2011

@toddparker
Contributor

I just tagged this as a feature request. WOuld you mind adding a link to this issue from the feature request wiki page so we can give this another look post-1,0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @toddparker@offsky

        Issue actions

          listview('refresh') does not update data-icon · Issue #3035 · jquery-archive/jquery-mobile