question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 6 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
Evolutocommented, May 15, 2020

Use column config: [selected]="selected" [selectionType]="'checkbox'" [selectAllRowsOnPage]="false" (select)='onSelect($event) and then pass object to onSelect(): onSelect({selected}) { this.selected = selected; }

0reactions
Broseph00commented, Jun 12, 2018

Experiencing same issue

  • Angular Version: 4.3.1

  • Typescript 2.4.2

  • Table: 9.3.1

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found