I\'m currently exploring jQuery Mobile to develop a mobile version of a dashboard with ordertracking information. And what the plan is, is to use a simple unordered list with al
If you use @Jasper's code on a list with auto-dividers you might find that the hidden "no results" element stills creates a divider. To avoid that I used this code:
if ($listview.children(':visible').not('#no-results').length === 0) {
// if none are found then fadeIn the `#no-results` element
$('#no-results').fadeIn(500);
} else {
// if results are found then fadeOut the `#no-results` element which
// has no effect if it's already hidden
$('#no-results').fadeOut(250);
$listview.children('.ui-li-divider:visible').not('#no-results').each(function() {
if($(this).next("#no-results").length > 0)
$(this).hide();
});
}
If anyone has a better solution please share.