Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Small bug fix in _toStr #295

Merged
merged 2 commits into from

2 participants

@OlegKi

The bug fix I post together with the changes to

By the way, one can additionally remove if(_trim){phrase=$.trim(phrase);} from _toStr. The functions this.trim and this.noTrim will be not used in jqGrid. So one can consider to delete the methods and all tests for _trim from the code.

Best regards
Oleg

OlegKi added some commits
@OlegKi OlegKi Small changes which allows to support custom controls in the searchin…
…g gialog.

As an example see in [the demo](http://www.ok-soft-gmbh.com/jqGrid/Ranking2.htm) the searching dialog and choose the value of Ranking.

Introduce `$.jgrid.filter` to allow some changes (for example extend `ops` with additional operation like BETWEEN) without modification of the source code.

Best regards
Oleg

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
03d3133
@OlegKi OlegKi Fix exception in `_toStr` in the function `.toLowerCase()` called for…
… non string data (Numbers for example).

Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
92b3616
@tonytomov tonytomov merged commit b8bff13 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @OlegKi

    Small changes which allows to support custom controls in the searchin…

    OlegKi authored
    …g gialog.
    
    As an example see in [the demo](http://www.ok-soft-gmbh.com/jqGrid/Ranking2.htm) the searching dialog and choose the value of Ranking.
    
    Introduce `$.jgrid.filter` to allow some changes (for example extend `ops` with additional operation like BETWEEN) without modification of the source code.
    
    Best regards
    Oleg
    
    Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
  2. @OlegKi

    Fix exception in `_toStr` in the function `.toLowerCase()` called for…

    OlegKi authored
    … non string data (Numbers for example).
    
    Signed-off-by: Dr. Oleg Kiriljuk <oleg.kiriljuk@ok-soft-gmbh.com>
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 7 deletions.
  1. +1 −4 js/grid.base.js
  2. +5 −3 js/grid.filter.js
View
5 js/grid.base.js
@@ -244,11 +244,8 @@ $.extend($.jgrid,{
if(_trim){
phrase=$.trim(phrase);
}
- if(!_usecase){
- phrase=phrase.toLowerCase();
- }
phrase=phrase.toString().replace(/\\/g,'\\\\').replace(/\"/g,'\\"');
- return phrase;
+ return _usecase ? phrase : phrase.toLowerCase();
};
this._funcLoop=function(func){
var results=[];
View
8 js/grid.filter.js
@@ -76,7 +76,7 @@ $.fn.jqFilter = function( arg ) {
groupButton : true,
ruleButtons : true,
direction : "ltr"
- }, arg || {});
+ }, $.jgrid.filter, arg || {});
return this.each( function() {
if (this.filter) {return;}
this.p = p;
@@ -409,7 +409,9 @@ $.fn.jqFilter = function( arg ) {
$(".input-elm",trpar).bind('change',function( e ) {
var tmo = $(this).hasClass("ui-autocomplete-input") ? 200 :0;
setTimeout(function(){
- rule.data = e.target.value;
+ var elem = e.target;
+ rule.data = rule.data = elem.nodeName.toUpperCase() === "SPAN" && cm.searchoptions && $.isFunction(cm.searchoptions.custom_value) ?
+ cm.searchoptions.custom_value($(elem).children(".customelement:first"), 'get') : elem.value;
that.onchange(); // signals that the filter has changed
}, tmo);
});
@@ -499,7 +501,7 @@ $.fn.jqFilter = function( arg ) {
$(ruleDataInput)
.addClass("input-elm")
.bind('change', function() {
- rule.data = $(this).val();
+ rule.data = cm.inputtype === 'custom' ? cm.searchoptions.custom_value($(this).children(".customelement:first"),'get') : $(this).val();
that.onchange(); // signals that the filter has changed
});
Something went wrong with that request. Please try again.