vencees / jquery-datatables-column-filter

Automatically exported from code.google.com/p/jquery-datatables-column-filter
0 stars 0 forks source link

Logical error with From and to functionality #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load the page 
http://jquery-datatables-column-filter.googlecode.com/svn/trunk/numberRange.html
2. Set "From" for employees to 116
3. Then set "to" for employees to 109 

What is the expected output? What do you see instead?
After step 2 I got the expected 4 records. After step 3 I would expect to see 
no records as no firms have >= 116 and <= 109 employees.

What version of the product are you using? On what operating system?
Latest online version @ 14 March 2013. Win7 64 bit.

Please provide any additional information below.
If you think (like me) that this is an error of logic it's an easy one to fix. 
Presumably the same thing happens with date fields.

Original issue reported on code.google.com by and...@howefamily.co.uk on 14 Mar 2013 at 10:14

GoogleCodeExporter commented 8 years ago
Sorry, it's a little more subtle than I appreciated. Yuo might want to call 
this a "feature".

Essentially when you do steps 2 and 3 then move away from the "to" field 0 
records are indeed returned. One could argue that this is sensible, because the 
user may be waiting to put 1090 rather than 109. However this behaviour is 
somewhat inconsistent with the scenario where "from" and "to" work on their 
own; typing in *just* 109 to the "to" box. Or indeed where they work together 
but return a positive (and correct) number of records.

I've tried the obvious logical tweaks to the code without success; the code

                else if (iMin <= iValue && iValue <= iMax) {
                    return true;

should fail and the return false should kick in. What am I missing?

Original comment by and...@howefamily.co.uk on 14 Mar 2013 at 12:11