Comments (4)
I've been thinking more about this, and I think that you're right that we can make everything "valueAsId" to make the programming model simpler. So the "value" prop would take one or more IDs, and the "onChange" would return one or more IDs. My only addition to this is to have "onChange" also return the valueAsObject in a second argument. So that one could have:
onChange: function (value, valueObject) {
var newRecord = _.clone(this.state.record);
newRecord['fooID'] = value;
newRecord['fooName'] = valueObject.name;
this.setState({ record: newRecord });
}
I like using a second argument for the "valueAsObject" because then people who just want to stick with IDs can totally ignore it.
What do you think?
from wingspan-forms.
Your proposal would lower the implementation complexity of valueAsObject and I think it's a good idea. The open question is if valueAsObject ought to be permitted at all as it limits how far you can abstract.
from wingspan-forms.
At this point, I'd say to not permit "valueAsObject" at all. The client (or even AutoControl) can dereference object values pretty easily. My thought was to make AutoControl do this, so records that use object-style properties would be able to continue to work unchanged. AutoControl already knows what the "valueField" and "displayField" is for a combo...
from wingspan-forms.
I agree with you and think permitting only valueAsId would result in simpler application code. Just note that "dereferencing an object value" in the most general way possible probably requires ajax, which can lead to a very request heavy app, which is why no consensus on this issue was reached. Though I would expect a lot of the requests can be mitigated through browser cache and hand optimization in hot spots. I also expect that this is a pretty involved refactor (for the TMF).
from wingspan-forms.
Related Issues (20)
- Search Box clear icon shouldn't appear when the value is empty
- Fixes for React 0.11,0.12
- Remove SelectionListDismissable
- Can't find module kendo HOT 8
- Work with Browserify HOT 6
- Add "KendoDropDownList" HOT 3
- KendoGridPicker selection state becomes inconsistent HOT 2
- MultiSelect onChange broken
- RadioGroup should have props like KendoComboBox HOT 4
- Simplify generated CSS
- Widget wrapper elements cause breaks in React-owned DOM tree
- KendoAutoComplete should have onSelect prop
- Support single-select with KendoGridPicker
- Add prop to KendoGrid for specifying a row tooltip
- Text fields should trim on blur by default
- What is your favorite react form implementation? HOT 1
- NPM package includes multiple copies of Kendo-UI HOT 2
- KendoComboBox should prevent adding custom values
- Cleanup warnings for React 0.14 HOT 6
- Add style property to MultilineText
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 wingspan-forms.