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

Set Selected state on Select #247

Open
sjorsjes opened this issue Aug 12, 2014 · 0 comments
Open

Set Selected state on Select #247

sjorsjes opened this issue Aug 12, 2014 · 0 comments

Comments

@sjorsjes
Copy link

Hi,

This is the first time I'm using StickIt in an actual project. So far so good and it works awesome.
But I was wondering if it is possible to set a selected state on the select StickIt generates? Couldn't find it in the documentation or in the source. Am I missing something or should I write my own functionality for this.

My model looks like this:

[{
    'Id': 'Id01',
    'Name': 'Name01'
    'Active': false
}, {
    'Id': 'Id02',
    'Name': 'Name02'
    'Active': true
}]

In my view i'm doing the following:

bindings: {
    'select': {
        observe: 'List',
        selectOptions: {
            collection: 'this.model.list',
            labelPath: 'Name',
            valuePath: 'Id'
        }
    }
}

But what I want to set the "selected" state on the item that has 'Active': true. Any native StickIt way to handle this?

Thanks in advance!

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