|
1653 | 1653 | }
|
1654 | 1654 |
|
1655 | 1655 | function defaultExporterFieldCallback(grid, row, col, value) {
|
1656 |
| - // fix to handle cases with 'number : 1' or 'date:MM-dd-YYYY', etc.. We needed to split the string |
| 1656 | + // fix to handle cases with 'number : 1' or 'date:"MM-dd-YYYY HH:mm"', etc.. We needed to split the string |
1657 | 1657 | if (col.cellFilter) {
|
1658 |
| - var args, filter, arg1, arg2; |
1659 |
| - // remove space, single/double to mantein retro-compatibility |
1660 |
| - args = col.cellFilter.replace(/[\'\"\s]/g, "").split(':'); |
1661 |
| - filter = args[0] ? args[0] : null; |
1662 |
| - arg1 = args[1] ? args[1] : null; |
1663 |
| - arg2 = args[2] ? args[2] : null; |
| 1658 | + var args, filter, arg1, arg2; |
| 1659 | + // Split on ':' except when in double quotes. |
| 1660 | + args = col.cellFilter.match(/(?:[^:"]+|"[^"]*")+/g); |
| 1661 | + // remove space, single/double to maintain retro-compatibility, but keep spaces in second argument (arg[1]) |
| 1662 | + filter = args[0] ? args[0].replace(/[\'\"\s]/g, "") : null; |
| 1663 | + arg1 = args[1] ? args[1].replace(/[\'\"]/g, "").trim() : null; |
| 1664 | + arg2 = args[2] ? args[2].replace(/[\'\"\s]/g, "") : null; |
1664 | 1665 | return $filter(filter)(value, arg1, arg2);
|
1665 | 1666 | } else {
|
1666 | 1667 | return value;
|
|
0 commit comments