ngx-datatable selecting both a row and a checkbox

Discussão em 'Angular' iniciado por born2net, Agosto 18, 2025.

  1. born2net

    born2net Guest

    So I have need to support both checkbox selection per row as well as selecting the row itself. the problem is when I support checkbox selection I am not longer notified when a row is selected. here is the code:

    <ngx-datatable #table class="material dark"
    style="width: 90%"
    [rows]="rows"
    [columnMode]="'force'"
    [headerHeight]="50"
    [columns]="columns"
    [footerHeight]="50"
    rowHeight="auto"
    [limit]="50"
    [selected]="selected"
    [selectionType]="'checkbox'"
    [selectAllRowsOnPage]="false"
    [displayCheck]="displayCheck"
    (activate)="onActivate($event)"
    (onClick )="onClick($event)">


    Now I am able to get both selection, per row and per checkbox since I added the (onClick), the problem is that I don't get the data object selected since onClick no longer get me any useful $event information (it has Input x y etc...)

    Basically all I am trying to do is support both chebox selection (which works fine now) but at the same time support row selection and get the Object of the row of the selected row item when (onClick) is fired.

    Thanks

    Sean

    Continue reading...

Compartilhe esta Página