var pagesize=100,pageindex=1;
var trtemplate,trgetemplate;
$(document).ready (loaddata);

 function loaddata()
{  
       
   trtemplate=$('#tablist').find('#trlist').clone();
   trgetemplate=$('#tablist').find('#trlistge').clone();
    $('#tablist').find('tbody').empty();
   pagelist(pageindex); 
}


/*****^*****^*****^*****^*****^*****^*****^*****^*****^*****^*****
 ** 
 ** ¼ÓÔØ·ÖÒ³
 ** 
 *****^*****^*****^*****^*****^*****^*****^*****^*****^*****^*****/
function pagelist(pageIndextmp)
{
    pageindex=pageIndextmp;
    showloading(true);
    QnSoft.controls.xwzx.getposts(pageindex,pagesize,list_callback);
};



function list_callback(res)
{
    $('#tablist').find('tbody').empty();
    
    var _dtdata=res.tables[0];
    var _dtpagelist=res.tables[1]; 
    $.each(_dtpagelist.rows,function(){
        $('#pagelist').html(this.pagelist);
    });
                  
    $.each(_dtdata.rows,function(){ 
       var tr=trtemplate.clone();
       $(tr).attr("id",this.PostID);
       $(tr).find('#subject').html(this.Subject);
       $(tr).find('#subject').attr('href','xwzxshow.aspx?id='+this.PostID);
       $(tr).find('#lbldate').html(this.PrintDate);

       $(tr).appendTo($('#tablist').find('tbody'));
       
       var trge=trgetemplate.clone();
       $(trge).attr("id",'ge'+this.PostID);
       $(trge).appendTo($('#tablist').find('tbody'));
       
   });   
   showloading(false);
}




