We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Filter bar problem with number fields

Hello there,
I'm using Vue data grid and I have some string and number columns. I have define column type and my data is showing perfectly.
My problem is when I search in filter bar for the columns with number data type, it's not working.
I have found that the default filter operator is Equal and it is not working for number data types, but when I tried Greater Than and Equal or Less Than and Equal, they worked ok.
Please kindly help me with my issue and tell me if you need any sample code.
Thanks
Masoud

6 Replies

PS Pavithra Subramaniyam Syncfusion Team November 5, 2019 04:49 AM UTC

Hi Masoud, 
 
Greetings from Syncfusion. 
 
In Essential JavaScript 2 Grid filter bar, the default operator will be equal for number columns and it will dhow data only the value is matched with the records. This is the default behavior. And it is working fine at our end. Please refer to the below documentation and demo link for more information. 
 
 
If you are still facing the issue please share the below details that will be helpful for us to provide a better solution as early as possible. 
 
  1. Share the Grid related code.
  2. Share the sample dataSource of your Grid.
  3. Share the Syncfusion version you are using
  4. Share the stack trace if any script error.
 
Regards, 
Pavithra S. 



MM Masoud Moghaddari November 9, 2019 02:33 PM UTC

Hi Pavithra,

Please kindly find the attached sample code.

Thanks
Masoud

Attachment: sample_e5e62dfc.zip


MM Masoud Moghaddari November 11, 2019 08:48 AM UTC

Hi there,

I've found my problem. Filter bar is not working when my data type is decimal (in mysql), but it works good with integer and double data types.
how can I make it work with decimal data type?

Thanks
Masoud


PS Pavithra Subramaniyam Syncfusion Team November 11, 2019 10:42 AM UTC

Hi Masoud, 
 
Thanks for sharing the details. 
 
We checked your query with provided code snippet but unfortunately were not able to reproduce it. You have mentioned that the filter bar is not working when having decimal values in the column but on checking it was working fine in our end. Please find the sample based on your provided code for reference from below, 
 
 
Can you please let us know the Syncfusion package version that you are using in your application and if any console errors are getting thrown while filtering. It would also be helpful for us to identify your issue better if you could provide us a simple working sample for reproducing the issue or if possible try to reproduce it in the above provided sample so that we can check and provide you the proper solution for it. 
 
Regards, 
Pavithra S. 



MM Masoud Moghaddari November 12, 2019 06:27 AM UTC

Hi Pavithra,

Please refer to this sample:
https://codesandbox.io/s/146774-dynamic-grid-modified-7vu9d

Thanks
Masoud


PS Pavithra Subramaniyam Syncfusion Team November 13, 2019 12:22 PM UTC

Hi Masoud, 
 
In the provided sample application you have given the credit_amount and debit_amount field values as string type in the data source. But in the column you have mentioned the type as number. This is the root cause for your issue. You can resolve this by either giving the type as string for these columns or parse these column values into number before assigning it to the grid. 
 
We have modified the sample by giving the column type as string based on the data source field value. You can find it below, 
 
 
Let us know if you have any concerns. 
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon