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.