From aa3f3be67f6054b5586098dd32b5357d8fa69c84 Mon Sep 17 00:00:00 2001 From: Julio de Alba Date: Thu, 22 Sep 2022 07:07:20 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20check=20all=20filtered?= =?UTF-8?q?=20rows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When datatable has filters applied, and the "check all" is used, it will check only the rows that match the filters. --- src/rowmanager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rowmanager.js b/src/rowmanager.js index 16eb5f5..6f27bf0 100644 --- a/src/rowmanager.js +++ b/src/rowmanager.js @@ -113,7 +113,13 @@ export default class RowManager { // update internal map if (toggle) { - this.checkMap = Array.from(Array(this.getTotalRows())).map(c => value); + if (this.datamanager._filteredRows) { + this.datamanager._filteredRows.forEach(f => { + this.checkRow(f, toggle); + }); + } else { + this.checkMap = Array.from(Array(this.getTotalRows())).map(c => value); + } } else { this.checkMap = []; }