Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ez on Feb 03, 2009 07:04
open dhtmlx forum
#numeric_filter has broken ">=" filtering mode, fix included

I found this while working with data_filter implementation in current v.2.0 build 81107:

In file: ext/dhtmlxgrid_filter.js,
in function: dhtmlXGridObject.prototype._in_header_numeric_filter = function(t, i)

we have regex match:

r = v.match(/>|>=|<=|</)
            if (r) {
                op = r[0];
                num = parseFloat(v.replace(op, ""))
            };

It works that way: find operator, and remove it from value, but when operator is ">=" the first match is correct (">" includes in ">=") and v.replace(op,"") will remove ONLY ">" char instead whole ">=" operator.
Because of this filtering ">=" will fall.

The fix is simple:

r = v.match(/>=|<=|>|</)

And it works, because ">=" not includes in ">" :)
Answer posted by Support on Feb 03, 2009 07:26
You are correct.
Fix will be added in main codebase and released as part of next build. 
Thanks for your remark.