Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda