Skip to content

Commit 3207b29

Browse files
ginemportuga
authored andcommitted
fix(exporter): Handle filters with 3 arguments
This should fix export csv with cellFilter. closes #6784
1 parent 7fc39ad commit 3207b29

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/features/exporter/js/exporter.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,13 @@
16531653
function defaultExporterFieldCallback(grid, row, col, value) {
16541654
// fix to handle cases with 'number : 1' or 'date:MM-dd-YYYY', etc.. We needed to split the string
16551655
if (col.cellFilter) {
1656-
return $filter(col.cellFilter.split(': ')[0].trim())(value);
1656+
var args, filter, arg1, arg2;
1657+
// remove space, single/double to mantein retro-compatibility
1658+
args = col.cellFilter.replace(/[\'\"\s]/g, "").split(':');
1659+
filter = args[0] ? args[0] : null;
1660+
arg1 = args[1] ? args[1] : null;
1661+
arg2 = args[2] ? args[2] : null;
1662+
return $filter(filter)(value, arg1, arg2);
16571663
} else {
16581664
return value;
16591665
}

0 commit comments

Comments
 (0)