How to show/hide primeng datatable column based on md-card selection in angular 2 application

Viewed 5912

I have 2 md-card : controller and Scheduler. On click of controller card i have to show controllerAssignedDate column and hide schedulerAssignedDate column and on click of Scheduler card i have to show schedulerAssignedDate column and hide controllerAssignedDate column. How can i do this in angular2 application

 <div><md-card-content><h3>Controller</h3></md-card-content></md-card></div>
 <div><md-card-content><h3>Scheduler</h3></md-card-content></md-card></div>

 <p-dataTable [value]="jobslist" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[10,30,50]" sortMode="multiple" scrollable="true"   resizableColumns="true" scrollHeight="350px" >

      <p-header>List of Jobs </p-header>

      <p-column field="partNumber" header ="Part Number" [sortable]="true" [filter]="true" ></p-column>
      <p-column field="lineName" header ="Line Name" [sortable]="true" [filter]="true"></p-column>
      <p-column field="jobStatus" header ="Job Status" [sortable]="true" [filter]="true"></p-column>
      <p-column field="owner" header ="Owner" [sortable]="true" [filter]="true"></p-column>
      <p-column field="startDate" header ="Scheduled Start Date" [sortable]="true" [filter]="true"></p-column>
      <p-column field="controllerAssignedDate" header ="Date Assigned to Controller" [sortable]="true" [filter]="true"></p-column>
      <p-column field="schedulerAssignedDate" header ="Date Assigned to Scheduler" [sortable]="true" [filter]="true"></p-column>   
      <p-footer><div class="ui-helper-clearfix" style="width:100%"><a [routerLink]="['/register','']" ><button type="button" pButton icon="fa-plus" style="float:left"  label="Add"></button></a></div></p-footer>

    </p-dataTable>
1 Answers
Related