1

我的列表视图无法查看时遇到问题。我从 j 查询的 $.post 方法调用 Web 服务并返回一个数据集。我的所有数据和信息都显示在页面上,但在我调用 listview.refresh 后,我在可折叠集中的列表视图没有刷新。这是我的代码:

$("#button").on("vclick",function()
{
   data = {}
   $.post("Web service",data,function(data1)
   {
      //clear the page
       $("#list containing the data-role collapsible set").html("");
       type = data.type;
       $.each(data1.ArrayName,function(i,value)
       {
           if(value.type != current)
           {
              $("div data-role='collapsible' data-collapse='false'><h3> +
              current + </h3><p class='add'></p></div>").appendTo("list containing +
               The data-role collapsible set");
               $('.add').append("<ul data-role='listview' class='list2'></ul>");
               current = type;
           }
           $(".list2").append("<li><a><div><span style='float:left'>" + data.info +
           "</span></div></a></li>");
           $("id for div with data-role collapsibleset").collapsibleset("refresh");
           $(".list2").listview("refresh");
       },"json");

   }
});
4

0 回答 0