Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
How to use Check All option in nglightning in angular 2

I need an option in nglightning to checkall records in datatable. The link for the component is as following

https://ng-lightning.github.io/ng-lightning/#/components

In the header row I need an option to check all checkboxes in nglightning.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I tried [] or [()] data binding first but it did not work. Created an ugly solution. You may need to ask ng-lighting why data binding does not work in column template.

Here is the Plunker: https://plnkr.co/edit/zNrWb4Ui2LVXc5fJb1oY?p=preview

Code I added:

<ngl-datatable-column heading="" key="points">
    <template nglDatatableHeading><input type="checkbox" (click)="toggleCheckAll()" /></template>
    <template nglDatatableCell><input type="checkbox" class="child-chkbox" /></template>
</ngl-datatable-column>

toggleCheckAll(){
    var chkboxes = document.getElementsByClassName('child-chkbox');
    this.checkAll = !this.checkAll;

    for(let i = 0; i < chkboxes.length; i++){
        chkboxes[i].checked = this.checkAll;
    }
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!