Home > front end >  The bootstrap - table ajax refresh regularly
The bootstrap - table ajax refresh regularly

Time:02-14

Small white consult regularly refresh data directly on the original data query after the increase has been repeated where's code has a problem I also tried to add $(" # TB "). BootstrapTable (' removeALL '); Not
The code is as follows:
$(function ()
{
$(" # TB "). BootstrapTable ({
Whether pagination: true,//display page article
PageSize: 5,//the default page shows the number of rows
PaginationLoop: true,//whether open paging infinite loops, when the last page on the following page is transferred to the first page
,15,25 pageList: [5],//choose shows how many rows per page
});
show();
SetInterval (function () {
show();
}, 1000 * 10);
$(' # 'TB) bootstrapTable (" hideLoading ");
})
The function show () {
$. Ajax ({
Url: '/VolunteerManagement/servlet/MessageServlet',
Type: 'get',
Datatype: 'json,
Success: the function (res)
{
$(" # TB "). BootstrapTable (" destroy ");
console.log(res);//in the console view data
$. Each ($. ParseJSON (res), function (the index, the apply) {
$(" # TB "). Append (
'& lt; Tr> + '
Apply. Send_name + "apply to the youth association" + '& lt;/td> '+ apply. Createtime + & lt;/td> + '
'& lt; A href="" & gt; Reject & lt;/a> + '
'& lt;/td> ')

});


},
});


}

</script>

CodePudding user response:

  •  Tags:  
  • Ajax
  • Related