From 55e35e140ea6dfe897f4eb4f2621db5fee561139 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 4 Apr 2018 17:01:08 +0530 Subject: [PATCH] [fix] allow cell formatter --- dist/frappe-datatable.cjs.js | 2 +- dist/frappe-datatable.js | 2 +- docs/assets/frappe-datatable.js | 2 +- src/cellmanager.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/frappe-datatable.cjs.js b/dist/frappe-datatable.cjs.js index b74aefe..6fbc838 100644 --- a/dist/frappe-datatable.cjs.js +++ b/dist/frappe-datatable.cjs.js @@ -2583,7 +2583,7 @@ class CellManager { const hasDropdown = isHeader && cell.dropdown !== false; const dropdown = hasDropdown ? `
${getDropdownHTML()}
` : ''; - const customFormatter = (cell.column && cell.column.format) || cell.format || null; + const customFormatter = cell.format || (cell.column && cell.column.format) || null; let contentHTML; if (isHeader || isFilter || !customFormatter) { diff --git a/dist/frappe-datatable.js b/dist/frappe-datatable.js index 402d13a..a32aca1 100644 --- a/dist/frappe-datatable.js +++ b/dist/frappe-datatable.js @@ -2582,7 +2582,7 @@ class CellManager { const hasDropdown = isHeader && cell.dropdown !== false; const dropdown = hasDropdown ? `
${getDropdownHTML()}
` : ''; - const customFormatter = (cell.column && cell.column.format) || cell.format || null; + const customFormatter = cell.format || (cell.column && cell.column.format) || null; let contentHTML; if (isHeader || isFilter || !customFormatter) { diff --git a/docs/assets/frappe-datatable.js b/docs/assets/frappe-datatable.js index 402d13a..a32aca1 100644 --- a/docs/assets/frappe-datatable.js +++ b/docs/assets/frappe-datatable.js @@ -2582,7 +2582,7 @@ class CellManager { const hasDropdown = isHeader && cell.dropdown !== false; const dropdown = hasDropdown ? `
${getDropdownHTML()}
` : ''; - const customFormatter = (cell.column && cell.column.format) || cell.format || null; + const customFormatter = cell.format || (cell.column && cell.column.format) || null; let contentHTML; if (isHeader || isFilter || !customFormatter) { diff --git a/src/cellmanager.js b/src/cellmanager.js index 2bf8eb1..ef15308 100644 --- a/src/cellmanager.js +++ b/src/cellmanager.js @@ -695,7 +695,7 @@ export default class CellManager { const hasDropdown = isHeader && cell.dropdown !== false; const dropdown = hasDropdown ? `
${getDropdownHTML()}
` : ''; - const customFormatter = (cell.column && cell.column.format) || cell.format || null; + const customFormatter = cell.format || (cell.column && cell.column.format) || null; let contentHTML; if (isHeader || isFilter || !customFormatter) {