Header checkbox not selecting rows.
See original GitHub issue[x] bug report
[ ] feature request
Current behavior
When in [selectionType]="'checkbox'"
, checking a headerCheckboxable
column doesn’t change the variable binded to the selected
attribute (although the other checkboxes change). Also, it makes the rest of the checkboxes stop functioning.
Expected behavior
It should add or remove all the items in the variable binded to the selected
attribute.
Reproduction of the problem I’m using this template:
<ngx-datatable class="material datatable stripped"
[style.height.px]="200" [scrollbarV]="true" [rows]="resumen" [columns]="resumenCols"
[selected]="seleccion" [selectionType]="'checkbox'" [messages]="mensajesTabla" [sorts]="[{prop: 'Desde'}]">
</ngx-datatable>
where…
resumenCols = [
{ headerCheckboxable: true, checkboxable: true, width: 20 },
{ prop: 'Nombre' },
{ prop: 'Desde', cellTemplate: this.tFecha },
{ prop: 'Hasta', cellTemplate: this.tFecha },
{ width: 20, cellTemplate: this.tQuitar }
];
resumen: Resumen[];
seleccion: Resumen[];
mensajesTabla: string;
Please tell us about your environment: Windows 7, VSCode, node 6.11.2
-
Table version: 9.3.1
-
Angular version: 4.3.2
-
Browser: Chrome
-
Language: TypeScript 2.4.2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Header checkbox selection doesn't work when using Server ...
The problem is that when I set headerCheckboxSelection and checkboxSelection to true, checkbox select appears next to each row but it doesn't ...
Read more >Column Header Checkbox not selecting all rows
Hi, I am facing one issue in which when i checked header check box of grid control then all items not selected only...
Read more >checkbox issue with Fixed header — DataTables forums
I am using datatable with fixed header. I have a checbox in the header and also in every row to select rows.
Read more >Row Selection - React Data Grid
It is possible to have a checkbox in the header for selection. To configure the column to have a checkbox, set colDef.headerCheckboxSelection=true ....
Read more >Header check box selection of rows using ojet 7.2.0
We are using Ojet 7.2.0. We have check box to select rows in ojet table. header checkbox selection (ie select All) is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use column config:
[selected]="selected"
[selectionType]="'checkbox'"
[selectAllRowsOnPage]="false"
(select)='onSelect($event)
and then pass object to onSelect():onSelect({selected}) { this.selected = selected; }
Experiencing same issue
Angular Version: 4.3.1
Typescript 2.4.2
Table: 9.3.1