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

Selectable bug #566

Open
mitchiru opened this issue Mar 21, 2017 · 0 comments
Open

Selectable bug #566

mitchiru opened this issue Mar 21, 2017 · 0 comments

Comments

@mitchiru
Copy link

mitchiru commented Mar 21, 2017

When I have a 1-n relation to be visualized by md-checks, I want to have the record to be the value in order to use standard ds. there is no proper option to use
optionValuePath='content'
optionLabelPath='content.name'

I would suggest following improvement to addon/components/selectable-item-group.js

if (valuePath && labelPath) {
return A(
content.map(el => {
return { value: get(el, valuePath), label: get(el, labelPath) };
})
);
} else if (labelPath) { // new option - has a label, but object == value
return A(
content.map(el => {
return { value: el, label: get(el, labelPath) };
})
);
} else {
return A(
content.map(el => {
return { value: el, label: el };
})
);
}

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