Skip to content

Commit 92138d3

Browse files
committed
fix formatter null value issues #174 and formatter being called with no data #178
1 parent d0a9b3a commit 92138d3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

slick.grid.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,9 +1715,12 @@ if (typeof Slick === "undefined") {
17151715
}
17161716
}
17171717

1718-
var value = null;
1719-
if (item) { value = getDataItemValueForColumn(item, m); }
1720-
var formatterResult = getFormatter(row, m)(row, cell, value, m, item);
1718+
var value = null, formatterResult = '';
1719+
if (item) {
1720+
value = getDataItemValueForColumn(item, m);
1721+
formatterResult = getFormatter(row, m)(row, cell, value, m, item);
1722+
if (formatterResult === null || formatterResult === undefined) { formatterResult = ''; }
1723+
}
17211724

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

0 commit comments

Comments
 (0)