Our blazing fast Grid component built with pure JavaScript


Post by peachaws »

Dear Team,

We are using the bryntum grid version 5.6.10 and are facing an issue with the filter value of a column having decimal values, especially decimal values of more than 2 digits. You can simply paste the below code in one of your online example sections and see it live. We tested it at https://bryntum.com/products/grid/examples/basic/

import { Grid } from '../../build/grid.module.js?484519';
import shared from '../_shared/shared.module.js?484519';

new Grid({

appendTo : 'container',

features : {
    group : false,
    filterBar: true, 
},    
 
  columns: [
    { field: 'id', text: 'ID', width: 80, filterable: true },
    { field: 'name', text: 'Name', flex: 1, filterable: true },
    {
      field: 'percentage',
      text: 'Completion %',
      align: 'right',
      flex: 1,
      
      renderer: ({ value }) => {
        const num = parseFloat(value);
        return isNaN(num) ? '-' : `${(num * 100).toFixed(2)}%`;
      }
    },
     {
      field: 'score',
      text: 'Score',
      align: 'right',
      flex: 1,
      
      renderer: ({ value }) => {
        const num = parseFloat(value);
        return isNaN(num) ? '-' : num.toFixed(2);
      }
    },
     {
      field: 'amount',
      text: 'Amount ($)',
      align: 'right',
      flex: 1,
      filterType: 'text',
      filterable: {
        filterFn: ({ record }, filter) => {
          const raw = record?.data?.amount;
          if (typeof raw !== 'number') return false;
          const formatted = raw.toFixed(2);
          const input = (filter?.value ?? '').toString().trim();
          return formatted.includes(input);
        }
      },
      renderer: ({ value }) => {
        const num = parseFloat(value);
        return isNaN(num) ? '-' : `$${num.toFixed(2)}`;
      }
    }
  ],
 data: [
    { id: 1, name: 'Alpha', percentage: 1.2312, score: 98.12, amount: 1200.50 },
    { id: 2, name: 'Beta', percentage: 0.8765, score: 75.00, amount: 843.33 },
    { id: 3, name: 'Gamma', percentage: 0.3291, score: 88.55, amount: 430.99 },
    { id: 4, name: 'Delta', percentage: 1.0511, score: 90.00, amount: 1030.00 },
    { id: 5, name: 'Epsilon', percentage: 0.0001, score: 70.10, amount: 0.99 }
  ]

});

The issue is that when we search the column containing decimal values, it does not filter properly.

Please do the needful to make it work.


Post by alex.l »

Hi!
Could you please explain what exactly is wrong with filtering? Steps to rerpoduce, actual result, expected result.
It will help us to understand the problem.

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post by peachaws »

alex.l wrote: Sun Apr 20, 2025 1:38 pm

Hi!
Could you please explain what exactly is wrong with filtering? Steps to rerpoduce, actual result, expected result.
It will help us to understand the problem.

Hi Alex,
Thank you for your response. We are experiencing an issue when trying to filter decimal values like 123.21. Specifically, the filtering does not work for three-digit numbers, while it functions correctly for two-digit numbers. Additionally, when I filter the value 123.21 and then try filtering the value 21, it only returns results that include 21 in the decimal place.

Overall, this appears to be a filtering issue with decimal values that contain more than two digits. I hope you have had a chance to try the sample code in your demo section, and I am attaching a video for your reference.

Recording 2025-04-22 101215.zip
video of filter issue
(22.39 MiB) Downloaded 12 times

It would be greatly appreciated if you could address and assist us in resolving this issue. Thank you!


Post by tasnim »

Thanks for the explanation and the video. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/11222

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post Reply