Hi,
In the filtering option of ejs grid contain a column having dates and as well as blanks . I need to ensure that the blanks are passed as a string ("blanks"), consistent with how it is handled on the backend. However, when using the filter option in Syncfusion's EJ2 Grid, the filter payload isn't handling this as expected.
how to adjust the filter event to correctly pass blanks as a string and modify the condition check for the filter properties in Syncfusion?
Hi Adarsh N P,
Greetings from Syncfusion support,
We understand your query regarding the filtering option in the Syncfusion EJ2 Grid, specifically the need to send blanks in the date column as a string ("blanks"). To accomplish this, you can modify the actionBegin event of the grid. By checking if the filter value is empty for the date column and replacing it with a string (like " "), you can ensure it is handled correctly on the backend. Here’s a simple code snippet:
|
methods: { onActionBegin(args) { if (args.requestType === "filtering" && args.columns) { args.columns.forEach((filter) => { if (filter.field === "OrderDate") { if (!filter.value) { filter.value = " "; // Replace empty value with a string } } }); } }, } |
Sample: https://stackblitz.com/edit/qctekr-ez3dqz?file=src%2FApp.vue
Please get back us if you need further assistance.
Regards,
Vikram S
Hi Vikram,
I implemented the solution you provided, but it's not working as expected. I'm still facing an issue with the date column filter. I need to send "blanks " in the date column as the string “blanks” .When the frontend passes these blanks to the backend, I want them to be recognized and processed as expected
when i pass above solution
if (!filter.value) {
filter.value = "blanks ";
}
it shows invalid date
When we provide a "blanks" as value, the value argument is considered an invalid date.
Hi Adarsh N P,
We understand that you're experiencing an issue with filtering the date column where blanks need to be passed as a string ("blanks"). Before we proceed with providing a solution for this requirement, we need some additional information to offer the most appropriate resolution. Kindly share the following details:
We appreciate your cooperation in providing us with the requested information, as it will help us provide a more effective solution to your query.
Regards,
Vikram S