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

Editor: pass the row object to the editorArgs function #1446

Merged
merged 9 commits into from
Jan 9, 2020

Conversation

msssk
Copy link
Contributor

@msssk msssk commented Jan 9, 2020

The Editor mixin can be configured with the editorArgs property. If the property is a function, it will receive the column definition as the first parameter. This PR updates the Editor mixin to also pass the row object, if available, as the second parameter. The row object is unavailable for shared editors.

yassam and others added 9 commits January 1, 2015 09:38
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 first 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.
@msssk msssk merged commit 17c7b70 into dojo:master Jan 9, 2020
@msssk msssk deleted the editor-pass-obj branch January 9, 2020 05:39
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