how to use renderBodyTemplate to filter state data?

UI Components for React
Post Reply
Posts: 2
Joined: 12 Sep 2020, 10:07

14 Sep 2020, 06:09

Hi ,

I am new to reactjs and primerecat too . I used datatable and column with renderBodyTemplate where I am filtering but it is error with undefiend please suggest a good way to use in renderBodyTemplate.

constructor(props) {

this.state = {

let role = this.state.roles.filter(val => !;
return <span>{}</span>


<Column field="roleId" header="Role" body={this.roleByRoleIdTemplate}></Column>

Posts: 4318
Joined: 29 Jun 2013, 12:38

10 Oct 2020, 21:17


I think this link can help to you; ... /datatable (please try 'edit in Codesandbox' button under source tab)

Please inform us again if you have any problems.
Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests