list_small.click(function(){
var data_id = $(this).attr("data-id"); // 獲取點擊節點的id
pages_list(data_id); // 通過函式傳給右邊表格
return false;
})
function pages_list(id) {
layui.use('table', function() {
var table = layui.table;
//第一個實體
table.render({
elem: '#my_table',
id: 'idTest',
height: 600,
url: 'https://www.shabidding?method=getNotice' //資料介面
,
// where: {'id': id},
// methods: 'post',
page: {
curr: 1
} //開啟分頁
,
// methods: 'get',
cols: [
[ //表頭
{
field: 'name',
title: '類別標簽',
.......
}
]
],
done: function(res, curr, count) {
$('th').css({
'color': '#112A7A'
}),
console.log(res);
//得到當前頁碼
console.log(curr);
}
});
table.reload('idTest', {
methods: 'post',
where: { //設定異步資料介面的額外引數,任意設
id: id
}
,page: {
curr: 1 //重新從第 1 頁開始
}
}); //只多載資料
為什么點擊后表格并沒有進行按id重新加載呢,一直顯示的是所有資料的頁面,,,請各位大佬幫忙解答一下啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/62608.html
標籤:JavaScript
上一篇:Django使用OSS
下一篇:JS代碼這個是如何呼叫的
