Skip to content
This repository

Small bug fix in _toStr #295

Merged
merged 2 commits into from about 2 years ago

2 participants

Dr. Oleg Kiriljuk Tony Tomov
Dr. Oleg Kiriljuk

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
Dr. Oleg Kiriljuk 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
Dr. Oleg Kiriljuk 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
Tony Tomov tonytomov merged commit b8bff13 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Apr 10, 2012
Dr. Oleg Kiriljuk 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
Dr. Oleg Kiriljuk 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
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 6 additions and 7 deletions. Show diff stats Hide diff stats

  1. +1 4 js/grid.base.js
  2. +5 3 js/grid.filter.js
5 js/grid.base.js
@@ -244,11 +244,8 @@ $.extend($.jgrid,{
244 244 if(_trim){
245 245 phrase=$.trim(phrase);
246 246 }
247   - if(!_usecase){
248   - phrase=phrase.toLowerCase();
249   - }
250 247 phrase=phrase.toString().replace(/\\/g,'\\\\').replace(/\"/g,'\\"');
251   - return phrase;
  248 + return _usecase ? phrase : phrase.toLowerCase();
252 249 };
253 250 this._funcLoop=function(func){
254 251 var results=[];
8 js/grid.filter.js
@@ -76,7 +76,7 @@ $.fn.jqFilter = function( arg ) {
76 76 groupButton : true,
77 77 ruleButtons : true,
78 78 direction : "ltr"
79   - }, arg || {});
  79 + }, $.jgrid.filter, arg || {});
80 80 return this.each( function() {
81 81 if (this.filter) {return;}
82 82 this.p = p;
@@ -409,7 +409,9 @@ $.fn.jqFilter = function( arg ) {
409 409 $(".input-elm",trpar).bind('change',function( e ) {
410 410 var tmo = $(this).hasClass("ui-autocomplete-input") ? 200 :0;
411 411 setTimeout(function(){
412   - rule.data = e.target.value;
  412 + var elem = e.target;
  413 + rule.data = rule.data = elem.nodeName.toUpperCase() === "SPAN" && cm.searchoptions && $.isFunction(cm.searchoptions.custom_value) ?
  414 + cm.searchoptions.custom_value($(elem).children(".customelement:first"), 'get') : elem.value;
413 415 that.onchange(); // signals that the filter has changed
414 416 }, tmo);
415 417 });
@@ -499,7 +501,7 @@ $.fn.jqFilter = function( arg ) {
499 501 $(ruleDataInput)
500 502 .addClass("input-elm")
501 503 .bind('change', function() {
502   - rule.data = $(this).val();
  504 + rule.data = cm.inputtype === 'custom' ? cm.searchoptions.custom_value($(this).children(".customelement:first"),'get') : $(this).val();
503 505 that.onchange(); // signals that the filter has changed
504 506 });
505 507

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.