renderBodyTemplate

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

13 Sep 2020, 06:17

Hi we are facing issue once using this.state.data inside the renderBodyTemplate for a datatable column, Please suggest the correct way to use the data filtering and fetching from this.state.


TypeError: Cannot read property 'roles' of undefined
232 |
233 |
234 | roleByRoleIdTemplate(rowData){
> 235 | let role = this.state.roles.filter(val => !rowData.roleId===val.id);
| ^ 236 | return <span>{role.name}</span>
237 |
238 | }

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

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest