e.g I have following dataTable.
Code: Select all
ProductType SystemName Request Time Response Time Message
Swap test 2018-02-12 <xml><sampleRequest></sampleRequest></xml>
Swap test 2018-02-12 <xml><sampleResponse></sampleResponse></xml>
Swap test 2018-03-12 <xml><sampleResponse></sampleResponse></xml>
Code: Select all
<p-dataTable [value]="uiModel" resizableColumns="true" scrollWidth="2100px" selectionMode="single" [(selection)]="selectedUIModel" (onRowSelect)="onRowSelect($event)" #dt>
<p-column field="productType" [sortable]="true" [filter]="true" header="Product Type" [style]="{'width':'100px'}"></p-column>
<p-column field="systemName" [sortable]="true" [filter]="true" header="System Name" [style]="{'width':'100px'}"></p-column>
<p-column field="requestTime" [sortable]="true" [filter]="true" header="Request Time" [style]="{'width':'150px'}"></p-column>
<p-column field="responseTime" [sortable]="true" [filter]="true" header="Request Time" [style]="{'width':'150px'}"></p-column>
<p-column field="message" header="Message" styleClass="content">
<ng-template let-lookup="rowData" pTemplate="body">
<span [style.color]="requestStyleclass" (click)="openModal(lookup.message)">{{lookup.message}}</span>
</ng-template>
</p-column>
</p-datatable>