jquery - Filter toolbar: data getting trimmed in free jqGrid -
we have data field padded 4 characters..
example, have "abc ", or "defg". data used value of select dropdown in filter toolbar.
when filter being built, padding getting trimmed; "abc " "abc".. filtering @ middle tier fails.. "abc" != "abc "
i modified jqgrid source remove trimming, safe? fixes issue, i'm not clear if i'm creating more problems.
/* format of element of searching toolbar if * format of cells in grid. 1 can't use * value = $.unformat.call($t, $elem, { colmodel: cm }, icol) * value. access value should * $elem.val() instead of $elem.text() used in common case of * formatter. have make manual conversion of searching filed * used integer/number/currency. code duplicate */ if (cm.stype === "custom" && $.isfunction(searchoptions.custom_value) && $elem.length > 0 && $elem[0].nodename.touppercase() === "span") { v = searchoptions.custom_value.call($t, $elem.children(".customelement").first(), "get"); } else { //v = $.trim($elem.val()); // *** commented out *** v = $elem.val(); switch (cm.formatter) { case "integer": v = cutthousandsseparator(v) .replace(getformateroption("decimalseparator", "number"), "."); if (v !== "") { // normalize strings "010.01" "10" v = string(parseint(v, 10)); } break; case "number": v = cutthousandsseparator(v) .replace(getformateroption("decimalseparator"), "."); if (v !== "") { // normalize strings "010.00" "10" // , "010.12" "10.12" v = string(parsefloat(v)); } break;
thank bug report!
it seems but, 1 should skip $.trim better in case of stype: "select". reduce side effects other cases. committed changes github (see here).
Comments
Post a Comment