Merge pull request #187 from frappe/nextchamp-saqib-patch-1

fix: `data` is undefined
This commit is contained in:
Saqib Ansari 2024-01-02 12:20:52 +05:30 committed by GitHub
commit ae07ce3712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,9 +35,11 @@ function getFilterMethod(rows, data, filter) {
let formatter = CellManager.getCustomCellFormatter(cell); let formatter = CellManager.getCustomCellFormatter(cell);
if (data && data.constructor.name === 'DataManager') { if (data && data.constructor.name === 'DataManager') {
data = data.getData(cell.rowIndex); data = data.getData(cell.rowIndex);
} else {
data = rows[cell.rowIndex]
} }
if (formatter && cell.content) { if (formatter && cell.content) {
cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, rows[cell.rowIndex], filter, data); cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, data, filter);
return stripHTML(cell.html); return stripHTML(cell.html);
} }
return cell.content || ''; return cell.content || '';