I am using filter search like this.But i have to create listview dynamically from database.pls help
1 Answer
Pseudo Code:
$('#aboutPage').live('pagecreate',function(event){
alert('This page was just loaded/enhanced by jQuery Mobile!');
// do ajax call to get list
$.ajax({
url: 'yourRequestPage.php?parm='+yourSearchParm[option],
type: 'GET',
error : function (){ document.title='error'; },
success: function (data) {
$('#selectOptionTag').html(data);
// Something like this:
$("div#selectOptionTag ul").listview();
// Or this
$('ul').listview('refresh');
}
});
});
3 Comments
naugtur
the two cases you put there require different way of loading the data. first - data must contain the ul tag, second - ul tag can't be overwritten.
Phill Pafford
Hence the Pseudo Code. Not overwriting the ul tag appending li tags and refreshing via ajax call. Just trying to give the op a idea on how to go about doing this
naugtur
Yes, I know. I did that a few times already and people said "no, it doesn't work" because they didn't fiddle with it, just put in their code and waited for it to work :P
pseudocode doesn't work for most people ;)