首页 > 解决方案 > 垫表中的复选框问题-Angular7

问题描述

当我们选择一个新的时,mat table 中先前选中的复选框不会被计算在内。由标题中的单个复选框处理的整个复选框列选择不考虑新检查或未检查的数据。

标签: javascriptcheckboxangular-materialangular7

解决方案


为了解决这个问题,我们必须在 component.ts 文件中的选择中传递索引位置:

前任 :

selection = new SelectionModel<PeriodicElement>(true, [this.dataSource.filteredData[1]);

推荐阅读