Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Selected property not documented in core-list-dart #121

Closed
fedy2 opened this issue Oct 2, 2014 · 3 comments
Closed

Selected property not documented in core-list-dart #121

fedy2 opened this issue Oct 2, 2014 · 3 comments

Comments

@fedy2
Copy link

fedy2 commented Oct 2, 2014

The 'selected' property is not documented in the CoreList class.

https://github.com/dart-lang/core-elements/blob/master/lib/core_list_dart.dart#L106

Can I use it to bind the selected item to my model?
Can I use it to select an item?

@jakemac53
Copy link
Contributor

This is a good question, this looks like it might be cruft? I think what you want is the 'selection' getter.

@jakemac53
Copy link
Contributor

Also, you should be aware that this element is undergoing a fairly large refactor soon, see this commit googlearchive/core-list@c6dd792.

@jakemac53
Copy link
Contributor

selectItem(int index) and setItemSelected(int index, bool isSelected) should be used to set selection.

The model passed to the core-list-dart template also has a 'selected' bool property now which you can use for styling/etc.

You can also grab the selection property to read items, but I don't think it is valid to modify it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants