Hi, I'm looking for a way to hide a column in my PrimeNG data table. Is there an attribute that can be used to turn off columns in PrimeNG data tables?
.Html
<p-dataTable emptyMessage="{{tbldatamsg}}" [value]="dataset" scrollable="true" [style]="{'overflow':'hidden!important'}"
[responsive]="true" [stacked]="stacked" [filters]="GlobalFilterValue" [rows]="20" sortMode="multiple" [(selection)]="selectedRow" selectionMode="multiple"
[resizableColumns]="true" columnResizeMode="expand" [paginator]="true" [globalFilter]="gb" [rowsPerPageOptions]="[10,15,20,25]"
appendTo="body" #dt>
<p-column styleClass="checkbox ui-resizable-column" [style]="{'width': 'auto'}" selectionMode="multiple"></p-column>
<p-column *ngFor="let col of cols;let j=index;" [style]="{'width':'130px'} "[field]="col.field" [header]="col.header" [sortable]="true"
[filter]="true" filterPlaceholder="Search" (mouseleave)="hoveredIndex=null" filterPlaceholder="Search" appendTo="body">
<ng-template let-row="rowData" let-i="rowIndex" pTemplate="body">
<!-- <div [pTooltip]="row[col.field]" [id]="col.field"> -->
<span *ngIf="col.field==='modified'" (mouseover)="passIndexValue(i) ">
<a style="color:black;">{{row[col.field]}}</a>
</span>
<p-button *ngIf="col.field==='modified' && hoveredIndex===i && !displayDialog " appendTo="body" icon="fa fa-fw fa-eye" (click)="onRowSelect($event,'View',i)"></p-button>
<p-button *ngIf="col.field==='modified' && hoveredIndex===i && !displayDialog" appendTo="body" icon="fa fa-fw fa-edit" (click)="onRowSelect($event,'Edit',i)" ></p-button>
<p-button *ngIf="col.field==='modified' && hoveredIndex===i && !displayDialog " appendTo="body" icon="fa fa-fw fa-trash" (click)="onRowSelect($event,'Delete',i)"></p-button>
<span *ngIf="col.field==='suggested_Value'">
<a style="color:black;">{{row[col.field]}}</a>
</span>
<!-- set String -->
<span (mouseover)="hoveredIndex=null" style="text-align:left;" *ngIf="col.datatype!='int' && col.datatype!='float' && col.field!='modified' && col.field!='suggested_Value'" >
{{row[col.field]}}
</span>
<!-- set int -->
<span (mouseover)="hoveredIndex=null" style="text-align:right;float: right" *ngIf="col.datatype=='int' || col.datatype=='float' && col.field!='modified' && col.field!='suggested_Value'" >
{{row[col.field]}}
</span>
</ng-template>
<!--<ng-template pTemplate="filter" let-colvalue>
<input *ngIf="col.field==='symbol'" type="text" pInputText style="width:100%" [(ngModel)]="SymbolFilterValue" (onChange)="ApplySymbolFilter(dt,SymbolFilterValue,col.field,col.filterMatchMode)" (input)="ColumnFilter(dt, $event.srcElement.value, col.field, col.filterMatchMode)" class="ui-column-filter"/>
<input *ngIf="col.field!='symbol'" type="text" pInputText style="width:100%" (input)="ColumnFilter(dt, $event.srcElement.value, col.field, col.filterMatchMode)" class="ui-column-filter"/>
</ng-template> -->
</p-column>
</p-dataTable>