Skip to content

defaultColumnBuilder doesn't work with custom interpolation symbols #6963

@jimoleary

Description

@jimoleary

There are a couple of other similar issues, but I don't think they are exactly the same.

I have been trying to get the headerTooltip property to work in a columnDefs with custom interpolation symbols ([[ and ]]).

As a result, the tooltip is rendered as the literal string '{{ col.headerTooltip(col) }}' rather than the value.

The following patch seems to fix the issue:

diff --git a/packages/core/src/js/services/gridClassFactory.js 
b/packages/core/src/js/services/gridClassFactory.js
index 59fa34a9..f2d615e1 100644
--- a/packages/core/src/js/services/gridClassFactory.js
+++ b/packages/core/src/js/services/gridClassFactory.js
@@ -112,12 +112,13 @@
                   }
 
                   if ( filterType ) {
-                    col[templateType] = template.replace(uiGridConstants.CUSTOM_FILTERS, function() {
+                    template = template.replace(uiGridConstants.CUSTOM_FILTERS, function() {
                       return col[filterType] ? "|" + col[filterType] : "";
                     });
-                  } else {
-                    col[templateType] = template;
                   }
+                  return gridUtil.postProcessTemplate(template).then(function(template) {
+                    col[templateType] = template;
+                  });
                 },
                 function () {
                   throw new Error("Couldn't fetch/use colDef." + templateType + " '" + colDef[templateType] + "'");

You can view the issue as a plnkr here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions