I am using primeng picklist in my project with turbo-table and want a little help in setting the source list.I have a master list that contains different lists.What I want is for each row of the table set the fetch the corresponding list from the master list array based on the id of that row.I don't know how to achieve this.Right now I'm setting source to the first element of the masterARR but I want to set it to the element based on the row id of the table. Please help.Thanks in advance.

Here is my template:

<p-table [columns]="cols" #dt [value]="students"  [autoLayout]="enable" dataKey="id" >

    <ng-template pTemplate="header" let-columns>
            <th style="width: 3em"></th>
            <th>Roll No</th>
    <ng-template pTemplate="body" let-rowData let-columns="columns">


    <p-dialog [(visible)]="display" [modal]="true" [responsive]="true" [style]="{width: '650px', minWidth: '200px'}" [minY]="70" [maximizable]="true" [baseZIndex]="10000">
        <p-pickList (onMoveToTarget)="onChange($event)" [source]="masterArr[0]" [target]="targetCars" sourceHeader="Available" targetHeader="Selected" [responsive]="true" filterBy="name" dragdrop="true" sourceFilterPlaceholder="Search by name" targetFilterPlaceholder="Search by name"
            [sourceStyle]="{'height':'300px'}" [targetStyle]="{'height':'300px'}">
            <ng-template let-hero let-rowdata pTemplate="item">
                    <div class="ui-helper-clearfix">
                        <div style="font-size:14px;float:right;margin:15px 5px 0 0"> {{hero.value}}</div>


Here is my ts code:


0 Answers