Comments (5)
Second that. Same problem has me stumped.
Any pointers would be very welcome.
from rivets.
select-multiple inputs now work with the standard data-value
binding in 0.3.10. Values should always be an array in this case — when the input changes, it will set the attribute with the array of selected values. Likewise, setting the attribute value to an array of selected values will update the select-multiple input's options accordingly.
from rivets.
In the general use case most select boxes are (id, name)
tuples where the ID is almost always a number.
Rivets.js expects to find a string so the following check fails where value
is [1,2]
and _ref is "1"
:
_results.push(o.selected = (_ref = o.value, __indexOf.call(value, _ref) >= 0));
It's better to check for bot strings
and numbers
(note: +_ref
converts string
to number
):
_results.push(o.selected = (_ref = o.value, __indexOf.call(value, _ref) >= 0 || __indexOf.call(value, +_ref) >= 0));
I thought about converting IDs to a string array on the server side before passing it on to the client but that wouldn't be right since the JSON model representation wouldn't truly reflect the model. Since in HTML all attributes are considered strings whether you quote them or not, the model-view binder should handle it.
For now I have made the above change in my rivetsjs hoping it gets patched. If the patch doesn't get accepted, should I be looking to make the change in the adapter?
from rivets.
Formatters are great! Just discovered their use through your other posting and will be using those in the interim.
from rivets.
I know this post is old but how can I set a select to be a select-multiple and rivets recognizes that?
<select data-rv-value="building_vent.value" multiple="multiple" size="5" type="select-multiple">
That doesnt work ...
from rivets.
Related Issues (20)
- Is there any way to use WC3 valid attributes for rivets? HOT 2
- rv-value does not get applied on bind for input type range HOT 2
- Add components dynamically in rivets.js not working
- the rv-show doesn't work in this case
- View don't update when use [].pop.call(thisObj) to change array model.
- Link to dist on website is broken
- Not working on mobile HOT 1
- Including jQuery AFTER rivets breaks rv-value binder HOT 1
- DOM not updating when model changes on onclick HOT 4
- Reset a binding before updating it?
- Error in specific scenario
- Databinding to an instance of a class works in Chrome, but not any other browser HOT 1
- Why not use VueJs? HOT 2
- Release of tinybind 1.0 HOT 1
- How to bind the change event of input using lastest rivets
- Passing identical data into binders and getting different results HOT 1
- rv- breaks if we add to document HOT 1
- Separate scopes / do not pollute global "rivets" configuration
- Cart quantity error
- Get Callback when component args change
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 rivets.