如何使用jquery mobile动态创建listview?

时间:2011-05-02 06:18:44

标签: android cordova jquery-mobile

我正在使用像this这样的过滤搜索。但是我必须从database.pls帮助动态创建listview

1 个答案:

答案 0 :(得分:1)

伪代码:

$('#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');
        }
    });
});