Comments (4)
You need to set the attribute on multi listbox like this <paper-listbox multi selected-values="[1, 2]">
. This is described in the list of paper-listbox
properties.
Also see #19.
from paper-listbox.
This is an example of how hard and hacky it gets without the feature (Dart):
//...userList was loaded from server via REST
//clear listbox items
PolymerDom listboxDom = Polymer.dom(userMultiChoice);
for (Node childNode in listboxDom.childNodes)
listboxDom.removeChild(childNode);
//recreate listbox items
List<int> selectedItems = new List<int>();
for (int i = 0; i < userList.length; i++) {
User user = userList[i];
for (String username in selectedUsernames) {//~~~~
if (username == user.username) {
selectedItems.add(i);
break;
}
}
PaperItem item = new PaperItem();
item.text = user.username;
listboxDom.append(item);
}
//apply selection
for (int item in selectedItems) {
userMultiChoice.select(item);
}
from paper-listbox.
This issue can probably be closed since @fcFn has clearly stated the answer...
from paper-listbox.
I have tried using paper-listbox multi selected-values="[1, 2]", and for it it only worked if the numbers are provided as String: ["1","2"]
Note that I use attr-for-selected="value"
with <paper-item value="0">AAA</paper-item>
etc
from paper-listbox.
Related Issues (20)
- [2.0-preview] up/down keyboard events don't update selected paper-item HOT 1
- paper-listbox does'nt have required property HOT 1
- A11y focus test fails
- When using shady DOM and programmatically inserting children the element will not render itself properly HOT 3
- paper-listbox doesn't update selected* properties after rebinding to new Array when the index stay the same
- left/right arrow keys
- [edge] rendering issue when `window.Polymer.lazyRegister` and `...useNativeCSSProperties` are `true`
- paper-listbox steals focus from paper-input
- Animation error HOT 2
- Broken layout and style in Edge 40 (EdgeHTML 15) HOT 4
- scroll with 'handle' is erratic HOT 2
- on-iron-activate fired before selected property changed
- Unselectable and hidden items on Edge HOT 1
- Add sub menu HOT 8
- Modifying paper-listbox scrollbar HOT 2
- iron-deselect not firing if selectedItems has default array
- no way to focus the selected item HOT 2
- Element not installable on Glitch
- Dropdown opens but then immediately closes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paper-listbox.