Skip to content

Commit

Permalink
fix formatter null value issues #174 and formatter being called with …
Browse files Browse the repository at this point in the history
…no data #178
  • Loading branch information
6pac committed Dec 10, 2017
1 parent d0a9b3a commit 92138d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1715,9 +1715,12 @@ if (typeof Slick === "undefined") {
}
}

var value = null;
if (item) { value = getDataItemValueForColumn(item, m); }
var formatterResult = getFormatter(row, m)(row, cell, value, m, item);
var value = null, formatterResult = '';
if (item) {
value = getDataItemValueForColumn(item, m);
formatterResult = getFormatter(row, m)(row, cell, value, m, item);
if (formatterResult === null || formatterResult === undefined) { formatterResult = ''; }
}

// get addl css class names from object type formatter return and from string type return of onBeforeAppendCell
var addlCssClasses = trigger(self.onBeforeAppendCell, { row: row, cell: cell, grid: self, value: value, dataContext: item }) || '';
Expand Down

0 comments on commit 92138d3

Please sign in to comment.