Skip to content

Validation tutorial - incorrect usage of setValidator/validatorFactory #5515

@phillipspc

Description

@phillipspc

In the tutorial, both in the written explanation and the accompanying example, the setValidator method returns a function which takes a series of arguments in the following order: function(newValue, oldValue, rowEntity, colDef).

However, from my experience using this method, this is incorrect, and should instead be: function(oldValue, newValue, rowEntity, colDef). This would appear to be consistent with how the validatorFactory is used in the source as well: https://github.com/angular-ui/ui-grid/blob/93c9d0b/src/features/validate/js/gridValidate.js#L380

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions