p-tableCheckbox check by default

Discussão em 'Angular' iniciado por travis_91, Janeiro 30, 2025.

  1. travis_91

    travis_91 Guest

    I'm new with primeNG and p-tableCheckbox. I'm using this component to create a checkbox column to check/select the right row. So the normal standard and behaviour works perfectly. But now I need to select by default some row/checkoxes by component.ts.

    I'm searching everywhere and I don't find anything about this behaviour.

    I tried something like this

    <p-tableCheckbox #tableCheckbox [value]="rowData" [index]="rowIndex"></p-tableCheckbox>

    checkSelected(event) {
    this.checkboxSelected.emit(event.data);
    this.tableCheckbox.checked = true;
    }


    where but obviously doesn't work. How can I make it work?

    Continue reading...

Compartilhe esta Página