Skip to content

Commit

Permalink
feat: expose grid in groupitemmetadataprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Mar 21, 2018
1 parent 733aeff commit 4c9b501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/example-grouping.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 134,15 @@ <h2>View Source:</h2>
var percentCompleteThreshold = 0;
var prevPercentCompleteThreshold = 0;

function avgTotalsFormatter(totals, columnDef) {
function avgTotalsFormatter(totals, columnDef, grid) {
var val = totals.avg && totals.avg[columnDef.field];
if (val != null) {
return "avg: " Math.round(val) "%";
}
return "";
}

function sumTotalsFormatter(totals, columnDef) {
function sumTotalsFormatter(totals, columnDef, grid) {
var val = totals.sum && totals.sum[columnDef.field];
if (val != null) {
return "total: " ((Math.round(parseFloat(val)*100)/100));
Expand Down
6 changes: 3 additions & 3 deletions slick.groupitemmetadataprovider.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 44,7 @@
options = $.extend(true, {}, _defaults, options);


function defaultGroupCellFormatter(row, cell, value, columnDef, item) {
function defaultGroupCellFormatter(row, cell, value, columnDef, item, grid) {
if (!options.enableExpandCollapse) {
return item.title;
}
Expand All @@ -62,8 62,8 @@
"</span>";
}

function defaultTotalsCellFormatter(row, cell, value, columnDef, item) {
return (columnDef.groupTotalsFormatter && columnDef.groupTotalsFormatter(item, columnDef)) || "";
function defaultTotalsCellFormatter(row, cell, value, columnDef, item, grid) {
return (columnDef.groupTotalsFormatter && columnDef.groupTotalsFormatter(item, columnDef, grid)) || "";
}


Expand Down

0 comments on commit 4c9b501

Please sign in to comment.