From 86fc8ef4b937ace5b7a2cadeed8a8f1853532982 Mon Sep 17 00:00:00 2001 From: Tony Tomov Date: Thu, 14 Jun 2012 15:24:43 +0300 Subject: [PATCH 1/2] Publishing v.4.4 --- js/grid.base.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/grid.base.js b/js/grid.base.js index ff67e1080..a500e5e74 100644 --- a/js/grid.base.js +++ b/js/grid.base.js @@ -2,12 +2,12 @@ // @compilation_level SIMPLE_OPTIMIZATIONS /** - * @license jqGrid 4.3.3 - jQuery Grid + * @license jqGrid 4.4.0 - jQuery Grid * Copyright (c) 2008, Tony Tomov, tony@trirand.com * Dual licensed under the MIT and GPL licenses * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl-2.0.html - * Date: 2012-05-31 + * Date: 2012-06-14 */ //jsHint options /*global document, window, jQuery, DOMParser, ActiveXObject, $, alert */ @@ -16,7 +16,7 @@ "use strict"; $.jgrid = $.jgrid || {}; $.extend($.jgrid,{ - version : "4.3.3", + version : "4.4.0", htmlDecode : function(value){ if(value && (value==' ' || value==' ' || (value.length===1 && value.charCodeAt(0)===160))) { return "";} return !value ? value : String(value).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&"); From 323cd03dfeb25149fcef89cd43d5bb995f359354 Mon Sep 17 00:00:00 2001 From: Tony Tomov Date: Thu, 14 Jun 2012 18:30:11 +0300 Subject: [PATCH 2/2] Last minute fixes for sowing summary on header. This will be in official 4.4 release since we have not make it public --- js/grid.grouping.js | 68 ++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/js/grid.grouping.js b/js/grid.grouping.js index e2ec43817..2fc91c026 100644 --- a/js/grid.grouping.js +++ b/js/grid.grouping.js @@ -3,7 +3,7 @@ "use strict"; $.extend($.jgrid,{ template : function(format){ //jqgformat - var args = $.makeArray(arguments).slice(1), j = 0; + var args = $.makeArray(arguments).slice(1), j = 1; if(format===undefined) { format = ""; } return format.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, function(m,i){ if(!isNaN(parseInt(i,10))) { @@ -89,15 +89,13 @@ $.jgrid.extend({ grp.groups.push({idx:i,dataIndex:fieldName,value:v, startRow: irow, cnt:1, summary : [] } ); grp.lastvalues[i] = v; grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)}; - if(grp.groupSummary[i]) { - $.each(grp.counters[i].summary,function() { - if ($.isFunction(this.st)) { - this.v = this.st.call($t, this.v, this.nm, record); - } else { - this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); - } - }); - } + $.each(grp.counters[i].summary,function() { + if ($.isFunction(this.st)) { + this.v = this.st.call($t, this.v, this.nm, record); + } else { + this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); + } + }); grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary; } else { if( (typeof(v) !== "object" && (grp.lastvalues[i] !== v) ) ) { @@ -106,15 +104,13 @@ $.jgrid.extend({ grp.lastvalues[i] = v; changed = 1; grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)}; - if(grp.groupSummary[i]) { - $.each(grp.counters[i].summary,function() { - if ($.isFunction(this.st)) { - this.v = this.st.call($t, this.v, this.nm, record); - } else { - this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); - } - }); - } + $.each(grp.counters[i].summary,function() { + if ($.isFunction(this.st)) { + this.v = this.st.call($t, this.v, this.nm, record); + } else { + this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); + } + }); grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary; } else { if (changed === 1) { @@ -122,29 +118,25 @@ $.jgrid.extend({ grp.groups.push({idx:i,dataIndex:fieldName,value:v, startRow: irow, cnt:1, summary : [] } ); grp.lastvalues[i] = v; grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)}; - if(grp.groupSummary[i]) { - $.each(grp.counters[i].summary,function() { - if ($.isFunction(this.st)) { - this.v = this.st.call($t, this.v, this.nm, record); - } else { - this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); - } - }); - } + $.each(grp.counters[i].summary,function() { + if ($.isFunction(this.st)) { + this.v = this.st.call($t, this.v, this.nm, record); + } else { + this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); + } + }); grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary; } else { grp.counters[i].cnt += 1; grp.groups[grp.counters[i].pos].cnt = grp.counters[i].cnt; - if(grp.groupSummary[i]) { - $.each(grp.counters[i].summary,function() { - if ($.isFunction(this.st)) { - this.v = this.st.call($t, this.v, this.nm, record); - } else { - this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); - } - }); - grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary; - } + $.each(grp.counters[i].summary,function() { + if ($.isFunction(this.st)) { + this.v = this.st.call($t, this.v, this.nm, record); + } else { + this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record); + } + }); + grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary; } } }