editorArgs function for always-on editors also takes object parameter #1061
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Editor mixin specifies a column property editorArgs, which can
either be an object or a function returning an object. If it's a
function, the function takes a column object as its parameter.
My change was to also pass the row object as the second parameter to
editorArgs. This can only be passed for always-on editors, so for
shared editors (aka editOn editors) only the column parameter is
passed (the object parameter is undefined).
I needed to create always-on editors with parameters that depended on
the row data, and this is the only way I could see of doing it. For
editOn editors it's possible to set up a handler for the
dgrid-editor-show event and get the row data that way, but I don't
think that event is emitted for always-on editors.