0

I am using filter search like this.But i have to create listview dynamically from database.pls help

2
  • is this when the page loads or are the links fetched via AJAX? Commented May 2, 2011 at 12:55
  • after page loads,i have to create search suggestion box Commented May 3, 2011 at 4:43

1 Answer 1

1

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');
        }
    });
});
Sign up to request clarification or add additional context in comments.

3 Comments

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.
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
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 ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.