I Need to Add ‘Select All’ Radio Button functionality in the Table Header of 3 Columns using p-table and p-radioButtons. Angular v16 and PrimeNG –

I need to build a function that checks all radio buttons (p-radioButton) in a single column contained in a p-table. I will have a ‘select all’ radio button in the table header for three columns consisting of radio buttons. The table header radio button will be mutually exclusive for the three columns of the p-table. When clicking column 1 ‘select all’ radio button, it selects all radio buttons in column 1 and unselects all previously selected radio buttons in column 2 and column 3. When clicking column 2 ‘select all’ radio button, it selects all radio buttons in column 2 and unselects all previously selected radio buttons in column 1 and column 3. When clicking column 3 ‘select all’ radio button, it selects all radio buttons in column 3 and unselects all previously selected radio buttons in column 1 and column 2. I have jQuery installed in my Angular app, so I can use it or plain vanilla JavaScript. I already have functionality to make each table row mutually exclusive for the three radio button columns so I expect that the ‘select all’ radio button when selected will inherit the same functionality for each table row. Can anyone help me achieve this functionality using the PrimeNG radio buttons (p-radioButton) and p-table? Thanks so much. Jeff

I added jQuery to my Angular solution and tested it. It is working correctly so I tried this:
The (click) event “onCheckAll($(this))” function was suggested here: Selecting multiple radio buttons with “Select All” option

onCheckAll(e) {   
    
    if (e.hasClass('allPrimary'))
    {
     $('.primary').prop('checked', true)
    }
    else if (e.hasClass('allSecondary'))
    {
     $('.secondary').prop('checked', true)
    }
    else (if (e.hasClass('allNotAuthorized'))
    {
     $('.notInCounty').prop('checked', true)
    }        
  }
<ng-template pTemplate="header">
                                <tr>
                                    <th pResizableColumn >County</th>
                                    <th pResizableColumn style="text-align:center">Primary
                                        <br />
                                        <p-radioButton
                                            name="all"
                                            class="allPrimary"                                            
                                            (click)="onCheckAll($(this))"                                             
                                        >
                                        </p-radioButton>
                                    </th>
                                    <th pResizableColumn style="text-align:center">Secondary
                                        <br />
                                        <p-radioButton
                                            name="all"
                                            class="allSecondary"                                            
                                            (click)="onCheckAll($(this))">
                                        </p-radioButton>
                                    </th>
                                    <th pResizableColumn style="text-align:center">Not Authorized
                                        <br />
                                        <p-radioButton
                                            name="all"
                                            class="allNotAuthorized"                                            
                                            (click)="onCheckAll($(this))">
                                        </p-radioButton>
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-areaOfOperationAll let-rowIndex="rowIndex">
                                <tr>
                                    <td >
                                        {{areaOfOperationAll.County.DisplayName}}                                    
                                    </td>
                                    <td style="text-align:center">                                        
                                        <p-radioButton
                                            name="county-primary-{{rowIndex}}"
                                            class="primary"
                                            [value]="true"
                                            [(ngModel)]="areaOfOperationAll.IsRankPrimary"                                   
                                            inputId="county-primary-{{rowIndex}}"
                                            (click)="onRankChange('IsRankPrimary',rowIndex)">
                                        </p-radioButton>
                                    </td>
                                    <td style="text-align:center">
                                        <p-radioButton
                                            name="county-secondary-{{rowIndex}}"
                                            class="secondary"
                                            [value]="true"
                                            [(ngModel)]="areaOfOperationAll.IsRankSecondary"
                                            inputId="county-secondary-{{rowIndex}}"
                                            (click)="onRankChange('IsRankSecondary',rowIndex)">
                                        </p-radioButton>
                                    </td>
                                    <td style="text-align:center">
                                        <p-radioButton
                                            name="county-na-{{rowIndex}}"
                                            class="notInCounty"
                                            [value]="true"
                                            [(ngModel)]="areaOfOperationAll.IsRankVendorNotInCounty"
                                            inputId="county-na-{{rowIndex}}"
                                            (click)="onRankChange('IsRankVendorNotInCounty',rowIndex)">
                                        </p-radioButton>                                    
                                    </td>
                                </tr>
                            </ng-template>

Error: I was getting a red squiggly line under the $ in the call (click)="onCheckAll($(this))" so I removed it to look like this (click)="onCheckAll(this)"   After making that change, the click event called the function correctly but then I started receiving this error in the console: TypeError: e.hasClass is not function. 

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật