Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultColumnBuilder doesn't work with custom interpolation symbols #6963

Closed
jimoleary opened this issue Apr 25, 2019 · 1 comment · Fixed by #7281
Closed

defaultColumnBuilder doesn't work with custom interpolation symbols #6963

jimoleary opened this issue Apr 25, 2019 · 1 comment · Fixed by #7281

Comments

@jimoleary
Copy link

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.

@crowtech7
Copy link

Is this issue still open? I'm wanting to contribute to an open-source project (my first time) for Hacktoberfest and looking around

@mportuga mportuga self-assigned this Jan 23, 2023
mportuga pushed a commit that referenced this issue Jan 23, 2023
Also, fix minor linting issue on test files.

Closes #6963
mportuga pushed a commit that referenced this issue Jan 23, 2023
Also, fix minor linting issue on test files.

Closes #6963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants