Fix substring search in LiveGrid column
authorJoey Schulze <joey@infodrom.org>
Mon, 4 Jun 2012 13:06:02 +0000 (15:06 +0200)
committerJoey Schulze <joey@infodrom.org>
Mon, 4 Jun 2012 13:06:02 +0000 (15:06 +0200)
lib/rico/ricoLiveGridAjax.js

index 6377aa9..2e694f9 100644 (file)
@@ -422,7 +422,11 @@ Rico.Buffer.AjaxSQLMethods.prototype = {
       queryHash['f['+colnum+'][len]']=c.filterValues.length;
       for (var i=0; i<c.filterValues.length; i++) {
         var fval=c.filterValues[i];
-        if (c.filterOp=='LIKE' && fval.indexOf('*')==-1) fval='*'+fval+'*';
+        if (c.filterOp=='LIKE' && fval.indexOf('*')==-1) {
+           if (c.format.filterUI.charAt(1) == '^') fval=fval+'*';
+           else if (c.format.filterUI.charAt(1) == '$') fval='*'+fval;
+           else fval='*'+fval+'*';
+       }
         queryHash['f['+colnum+']['+i+']']=fval;
       }
     }