vitmalina/w2ui — pull request #690 by sairum (2014-10-18 12:16:18+00:00)
Title: Fix problematic comparisons in grid.search function

Function w2grid.search(field,value) receives the value from w2fields.clean() which returns a value of type 'number'. When the search condition is explicitly 0 (i.e., zero, which is common, such as in a search of a two-valued field, like a boolean) the comparison

(val !='')

which occurs at several places in the function, returns false, although 'val' is actually a valid value. The correct comparison is (val !=='').
This fix allows for searches of 0 either in the 'toolbar Search' as well as in the 'Search Popup'