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

Ensure cellFilters in gridClassFactory are passed without modifications #3828

Merged

Conversation

joelmertanen
Copy link
Contributor

We have stored some precalculated data in UI-grid's row with the $$ prefix which we access in the column with Angular's filter. Regardless of if that is the best solution or not, I found the following unexpected behaviour:

A cell filter

testSetup.col.cellFilter = 'customCellFilter:row.entity.$$internalValue';

causes cell's filter template to be replaced with

customHeaderCellFilter:row.entity.$internalValue

. It is missing one dollar sign.

This is caused by String.prototype.replace()'s special replacement patterns. We can prevent this by passing the second parameter with an anonymous function in gridClassFactory.js.

Otherwise some character patterns would have unexpected behaviour.
For example, '$$' would be replaced with a '$'.
swalters added a commit that referenced this pull request Jun 22, 2015
…pure-string

Ensure cellFilters in gridClassFactory are passed without modifications
@swalters swalters merged commit 25480b5 into angular-ui:master Jun 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants