Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:tonytomov/jqGrid.git
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytomov committed Jun 15, 2012
2 parents 65f142a + 323cd03 commit f4281e5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 41 deletions.
6 changes: 3 additions & 3 deletions js/grid.base.js
Expand Up @@ -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 */
Expand All @@ -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(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
Expand Down
68 changes: 30 additions & 38 deletions js/grid.grouping.js
Expand Up @@ -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))) {
Expand Down Expand Up @@ -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) ) ) {
Expand All @@ -106,45 +104,39 @@ $.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) {
// This group has changed because an earlier group changed.
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;
}
}
}
Expand Down

0 comments on commit f4281e5

Please sign in to comment.