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

Using Onlyif but dependant on the parent viewmodel? #658

Open
jammy-git opened this issue Apr 16, 2018 · 0 comments
Open

Using Onlyif but dependant on the parent viewmodel? #658

jammy-git opened this issue Apr 16, 2018 · 0 comments

Comments

@jammy-git
Copy link

jammy-git commented Apr 16, 2018

We have a parent/child viewmodel set up so that a parent record can have multiple child records. We need a validation rule on the child record that is only required when a field on the parent has a certain value.

Is this possible?
I've tried this in the child viewmodel:
required: { onlyIf: function () { return parent.FieldX() == Value; } }
Where parent is the self variable passed from the parent viewmodel to the child viewmodel. No errors generated, but this still doesn't work.

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

No branches or pull requests

1 participant