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

Reload listview with thumbs #1016

Closed
thiagofesta opened this issue Feb 8, 2011 · 5 comments
Closed

Reload listview with thumbs #1016

thiagofesta opened this issue Feb 8, 2011 · 5 comments

Comments

@thiagofesta
Copy link

On the alpha 3 when i reload a listview and i append a list with thumbnails, the image didn't receive the class ui-li-thumb so as the list didn't receive the right classes.
It makes a wrong design.

I'm putting these classes manually on my append code. But it's a little bug.

@tsingme
Copy link

tsingme commented Mar 4, 2011

$list.listview('refresh');
var li = $list.children("li");
li.each(function(pos) {
var item = $(this);
item.addClass('ui-li-has-thumb');
});

@numbcoder
Copy link

after refresh
$li.removeClass('ui-li-has-alt')
.addClass('ui-li-has-thumb')
.find('img')
.addClass('ui-li-thumb');

@msprunck
Copy link

msprunck commented Apr 4, 2011

I have the same problem with the alpha 4.
It seems that the _itemApply function does not add the class when it is called after the refresh.

...
$list.find( "li" ).find( ">img:eq(0), >:first>img:eq(0)" )
...

This expression does not match any element when the surrounding divs are present.

@shazron
Copy link

shazron commented Apr 20, 2011

This happens on alpha 4 as well, although only the first element (that was added) does not get the class ui-li-has-thumb after a refresh (nor do child imgs in it)

@scottjehl
Copy link

I just tested this on the latest and it seems to be working now. Steps to reproduce:

  1. Go to http://jquerymobile.com/demos/1.0b1/docs/lists/lists-thumbnails.html

  2. Run the following via console:

    $(".ui-page-active .ui-listview:eq(0)").append( '<li><a href="index.html"><img src="images/album-k.jpg" /><h3>Hot Fuss</h3><p>Killers</p></a></li>' ).listview("refresh");
    

If you're talking about refreshing existing list items that you've modified, unfortunately, that's not something we'll be able to handle with the refresh method, as it'd be really complicated to re-parse the markup for changes.
thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants