Page 1 of 1

Using filter property of PrimeReact DataTable Columns

Posted: 11 Jun 2020, 20:26
by arojsubedi
One of the columns of the DataTable implemented is somewhat like this

{ field: 'FieldValuesAsText#XYZ', header: 'XYZ', width: '150px', sort: true, filterElement: 'No' }
<Column key={col.field} field={col.field} header={col.header} body={this.trimContent} filter={true} filterMatchMode="contains" sortable={col.sort} />


The FieldValuesAsText is a object with XYZ as one of it's attribute. The custom function used in the body property successfully retrieves the value but the problem is when I try to do the filter operation. Since the filter defaults to field which in this case is FieldValuesAsText#XYZ, so it is obviously going to return undefined. How will I be able to make my filter property work?