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
Description
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 commentedon Nov 14, 2011
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 commentedon Nov 14, 2011
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 commentedon Nov 14, 2011
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.