Hello,
I want to show the text instead of the id when using the Excel-like filter.
Here is the code for my dropdown:
The following picture will make it clear what i want to achieve:
Have a nice day!
Hi Harald,
Greetings from syncfusion support,
Based on your query we have prepared a sample of Grid in React and tried to reproduce your reported problem at our end, but it was unsuccessful. Please refer the below sample for more information.
Sample: https://stackblitz.com/edit/react-wq9vep?file=index.js,index.html
If you still facing this issue, please share the below mentioned details to us for further validation,
Above requested details will be helpful to validate further at our end and provide solution as earlier as possible.
Regards,
Vikram S
Hello,
I get the role from my database, here is how my "users" table looks like:
users: This table has the name, email etc. from the user and the "userrole", this is a foreign key to the "userroles" table which contains a number (1-3) and a Value (the rolename).
On the website, I load the data and each user has following code:
How can I achieve the behaviour you send with this?
Herald,
Please share the details requested in the previous update for further validation of the issue.
Hello Joseph,
I attached the code for my employees Grid.
For the User object I get from my API please see my latest answer in this thread.
Do you have any updates for me?
Hello Joseph,
Any Updates on this?
Hi Herald,
Sorry for the delay ,
We have reviewed your query and understood that when filtering the RoleID column you want to filter columns with role values but column should be showing id values this can be achieved by using foreignKeyValue and foreignKeyField property by inserting ForeignKey module to the GridComponent .We are attaching the sample API link for your reference.
<ColumnsDirective> <ColumnDirective field="OrderID" headerText="Order ID" width="200" textAlign="Right" isPrimaryKey="true" ></ColumnDirective>
<ColumnDirective field="CustomerID" headerText="CustomerID" width="200" ></ColumnDirective>
<ColumnDirective field="role" headerText="Role" width="200" textAlign="Right" ></ColumnDirective>
<ColumnDirective field="role" headerText="RollID" width="200" foreignKeyField="role" foreignKeyValue="roleID" dataSource={roles} ></ColumnDirective> </ColumnsDirective> <Inject services={[Filter, Page, Sort, Edit, ForeignKey]} /> </GridComponent> |
Sample API documentation: https://stackblitz.com/edit/react-wq9vep-2ngwel?file=index.js
ForeignKey Column documentation: https://ej2.syncfusion.com/react/documentation/grid/columns/foreign-key-column
Kindly get back to us if you need further assistance.
Regards,
Srinivas R.