Unanswered: Gird filtering issue on BigDecimal Column values
Unanswered: Gird filtering issue on BigDecimal Column values
I have implemented grid filtering using simple example as shown in gxt explorer FilterGrid.
I have applied NumericFilter on a value returning an amount value which is BigDecimal.
Everything works as expected - the filter shows up on the column header with >,< and = , however while > and < work as expected the "=" operator doesn't work and returns no values.
As each numeric type has different ways of checking, and as developers haven't been thrilled with the prospect of a dozen different filter objects for each possible comparable type, we have a default implementation to compare them. It turns out that java.lang.Number doesn't implement java.lang.Comparable, and the >, <, >=, <= operators don't work on BigDecimal or some other non-primitive Number classes.
We could add a compare method into the NumberPropertyEditor and subclasses, but that would come at the cost of causing changes in other projects. Instead, NumericField has two methods designed to be overriden in cases such as yours - greaterThan(V,V), and equals(V,V). In both cases, V is the numeric type you are working with.
We're open to thoughts and suggestions on how this api can be improved to be as flexible as possible, but try starting with these and seeing where you can get.