Home > front end >  Layui left number right table structure, now according to the left click on the node id to the table
Layui left number right table structure, now according to the left click on the node id to the table

Time:09-22

List_small. Click (function () {
Var data_id=$(this). Attr (" data - id ");//get click on the node id of the
Pages_list (data_id);//passed to the right function form
return false;
})

The function pages_list (id) {
Layui. Use (' table ', function () {
var table=layui.table;

//the first instance
Table. The render ({
Elem: '# my_table',
Id: 'idTest',
Height: 600,
Url: https://www.shabidding? Method=getNotice '//data interface
,

//the where: {" id ": id},
//the methods: 'post',
Page: {
Curr: 1

}//open the page
,
//the methods: 'get',
Cols: [
[//header
{
Field: 'name',
Title: 'category labels,
.
}
]
],
Done: function (res, curr, count) {
$(' th '). The CSS ({
'color' : '# 112 a7a'
}),
console.log(res);
//get the current page number
The console. The log (curr);
}

});

Table. Reload (' idTest '{
Methods: the 'post'
Where: {//set the additional parameters of asynchronous data interface, an arbitrary set
Id: the id
}
, page: {
Curr: 1//to begin from page 1
}
});//only overloading data

Why the final form and no load, according to the id page shows all the data,,,, every brother please help solve!