Hi,
How do I change the display values of the Excel type of filter? I have a complex column which I customize the data displayed on grid with the value accessor method. But I'd like to also show the number of elements on that field when trying to filter, instead of showing 'object':
Hi Christian,
Thanks for contacting Syncfusion support.
By analyzing your query, we suspect that you want to perform Grid actions on complex column. In EJ2 Grid, we have the support to bind complex fields in the Grid Column.
You can achieve complex data binding in the grid by using the dot(.) operator in the column.field. This is explained in the below documentation.
Complex Data Binding: https://ej2.syncfusion.com/vue/documentation/grid/columns/complex-data-binding/
|
[App.vue]
<e-column field="Name.FirstName" headerText="First Name" width="120" ></e-column>
|
|
[data.ts]
export let employeeData: Object[] = [ { EmployeeID: 1, Name: { LastName: "Davolio", FirstName: "Nancy" }, }]
|
sample: https://codesandbox.io/s/vue-template-forked-jrd7sy?file=/src/App.vue
Note:
By using the ColumnTemplate feature or valueAccessor API, you can show the customized value in the Grid column. But this is used only for display purposes. All the Grid actions like Filtering, Searching, Grouping, Sorting, etc., are performed with the Grid’s dataSource value based on its column field name and its type, not with the customized value. This is the intended behavior of EJ2 Grid.
Also, the EJ2 Grid column only supports number, string, date, dateTime, Boolean, checkbox type values, and it does not support array type values. Refer to the below documentation.
columnType: https://ej2.syncfusion.com/documentation/api/grid/columnType/
Still, if you have any concerns, kindly share the complete Grid code and type of the complex field (share example dataSource).
Regards,
Rajapandiyan S
Hi Raja,
That's not what I need. The notifications column is an array of objects. I need to customise the options displayed on the filter. As am example, I want to show the number of elements on the notifications array.
Hi Christian,
Thanks for your update.
As we already said in the previous update, the EJ2 Grid column does not support array type values and it only supports number, string, date, dateTime, Boolean, and checkbox type values. Refer to the below documentation.
UG: https://ej2.syncfusion.com/documentation/api/grid/columnType/
We can show an array of values in the Grid column (using the valueAccessor API and by iterating each array value in columnTemplate feature). But this is used only for display purposes. We cannot perform Grid actions like Filtering, Searching, Grouping, Sorting, etc., on the array type column. This is the behavior of EJ2 Grid.
So, it is not feasible to achieve your requirement at our end.
Regards,
Rajapandiyan S