From c86a2271e45accde3d5041685f54f0c0a115b7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 28 Jun 2022 21:01:21 +0800 Subject: [PATCH] add base attr for tableReload --- examples/table-test.html | 5 +++-- src/modules/table.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/table-test.html b/examples/table-test.html index 8cd07dbe..1fca3f28 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -117,15 +117,16 @@ layui.use(['table', 'dropdown'], function(){ //,width: 600 ,title: '用户数据表' ,url: 'json/table/demo1.json' + //,method: 'post' ,pagebar: '#pagebarDemo' // 分页栏模板 - ,lineStyle: 'height: 95px;' // 行样式 + //,lineStyle: 'height: 95px;' // 行样式 ,css: [ // 自定义样式 '.layui-table-page{text-align: right;}' ,'.layui-table-pagebar{float: left;}' ].join('') - //,size: 'lg' + //,size: 'sm' //,skin: 'line' //,autoSort: false //是否自动排序。如果否,则由服务端排序 //,loading: false diff --git a/src/modules/table.js b/src/modules/table.js index 5fd4228f..f55abbca 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1709,7 +1709,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ //复选框选择 that.elem.on('click', 'input[name="layTableCheckbox"]+', function(){ //替代元素的 click 事件 var checkbox = $(this).prev() - ,childs = that.layBody.find('input[name="layTableCheckbox"]') + ,children = that.layBody.find('input[name="layTableCheckbox"]') ,index = checkbox.parents('tr').eq(0).data('index') ,checked = checkbox[0].checked ,isAll = checkbox.attr('lay-filter') === 'layTableAllChoose'; @@ -1718,7 +1718,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ //全选 if(isAll){ - childs.each(function(i, item){ + children.each(function(i, item){ item.checked = checked; that.setCheckData(i, checked); }); @@ -2254,7 +2254,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ // 过滤与数据无关的参数 var dataParams = new RegExp('^('+ [ - 'data', 'url', 'where', 'page', 'limit', + 'data', 'url', 'method', 'contentType', + 'headers', 'where', 'page', 'limit', 'request', 'response', 'parseData' ].join('|') + ')$');