hjg
2024-03-18 8d48c59d5d3bcc4148ef97dc6f98e3a8cf9ca436
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function ttlist(page,pagesize,params,url,tbody,callback,pagediv,prepages_input,page_div)
{
    params.page=page;
    params.pagesize=pagesize;
    jQuery.post(url, parmas, function(data, textStatus, xhr) {
      if(data==null)
          return;
      var items=data.items;
      var pages=data.pages;
 
      var tbobj=$(tbody);
      tbobj.empty();
      if(callback!=null)
      {
          jQuery.each(items, function(index, val) {
             var str=callback(index,val);
             jQuery.append(str);
          });    
      }
      
      if(prepages_input!=null)
      {
          var prepages=prepages_input.val();
          if(prepages!=pages)
          {
              prepages_input.val(pages);
              jQuery(pagediv).bootpag({total:pages,maxVisible:10,page:page+1}).on('page',function(event,num){                  
                    getlist(num-1,pagesize,params,url,tbody,callback,pagediv);
                    });
          }    
      }
      if(page_div!=null)
         page_div.val(page);
    },'json');
}