From 780cd72ee2be0d89e3ab6772ad80bec92682f046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sat, 9 Dec 2023 12:55:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20table=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/table-test.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/table-test.html b/examples/table-test.html index 2772f388..9941be3b 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -222,13 +222,22 @@ layui.use(['table', 'dropdown'], function(){ },{ id: 'unchecked', title: '取消选中某行' + },{ + id: 'mult-checked', + title: '同时选中多个' },{ id: 'reset-checked', title: '给选中行取消选中状态' }], // 菜单被点击的事件 - click: function(obj){ - if(obj.id === 'reset-checked'){ + click: function(obj) { + if (obj.id === 'mult-checked') { + // 同时选中多个 + table.setRowChecked(id, { + index: [3, 4, 5], // 2.9.1+ + checked: true + }); + } else if(obj.id === 'reset-checked') { // 给选中行取消选中状态 table.setRowChecked(id, { index: 'all',