You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The reason for the first two changes are that for some work flows it is likely o
53
53
* * *
54
54
**Note**
55
55
56
-
The intention is for that mixing the previous name-level properties with these newer selector wide attributes should work well.
56
+
The intention is for that mixing the previous name-level properties with these newer selector wide attributes should work.
57
57
For example, given the following code:
58
58
59
59
```javascript
@@ -67,7 +67,23 @@ $("input").link(model,
67
67
});
68
68
```
69
69
70
-
All inputs on the page would be linked to model through the multiplication converter except for an input with the a name (or failing that, id) attribute attribute equal to "filename", which would use the the toLowerCase() converter. However, this is not yet implemented because it conflicts with the idea that specifying specific attributes, like "filename" above, would cause only that mapping to actually be created.
70
+
All inputs on the page would be linked to model through the multiplication converter except for an input with a name (or failing that, id) attribute equal to "filename", which would use the the toLowerCase converter. However, this is not yet implemented because it conflicts with the idea that specifying specific attributes, like "filename" above, would cause only that mapping to actually be created. Solutions:
71
+
1. The presence of selector wide keywords on the mapping object would imply that all elements matching the selector are to be bound, and any specific attribute named mappings would simply take precedence.
72
+
2. Specific attribute mappings would still imply that only those elements are to be mapped, and selector wide elements would simply provide additional functionality for those mappings. For example, you could specify a few attributes with name mappings, and have a selector wide __convert function that just applied to all those mappings:
This would imply that firstName is mapped one way to person["first-name"], lastName is two-way mapped to person["last-name"], and both mappings go through the UpperCase convert function.
86
+
4. Simply not allow mixing of the mapping styles.
71
87
72
88
## jQuery(..).link() API
73
89
@@ -212,7 +228,8 @@ This example links the height of the element with id "rank" to the salesRank fie
212
228
213
229
**Selector-wide converter functions**
214
230
215
-
As stated in the introduction, it is possible to apply selector-wide convert and convertBack functions. By using the keywords __convert and __convertBack at the highest level of the mapping object, it will apply the functions for all elements matching the selector. For example:"
231
+
As stated in the introduction, it is possible to apply selector-wide convert and convertBack functions. By using the keywords __convert and __convertBack at the highest level of the mapping object, it will apply the functions for all elements matching the selector. For example:
0 commit comments