Section | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Left unchecked, this options merging code becomes unruly and verbose. The vast majority of merging can be taken care of by a simple call to a standard "object merging function" such as jQuery.extend
- however, there are a few cases where this behaviour is inappropriate, and where manual merging code might still be required.
...
Code Block | ||||
---|---|---|---|---|
| ||||
fluid.merge(policy, target, source-1, ... source-n);
|
...
Policy value | Description |
---|---|
| If any value is found at the EL path in a "source" object, the value held at the "target" path will be cleared (that is, blasted back to an empty state with no properties) before the values are copied. |
New in v1.3:DEPRECATED | If any value is found at the EL path in a "source" object, the source object will be preserved i.e. the object will not be copied, but directly used. If any defaults exist, those will be merged into the source object.New in v1.4: |
| New in v1.4: |
|
|
| This is scheduled for deprecation |
Any other string value | The value will be interpreted as an EL path into source object. If after the merge operation, no value is present at the key EL value in the target object, this (right-hand) value will be interpreted as an EL path into the source, and the value copied from this EL into the key EL into the target. |
function | Rather than perform any merge operation, the key will be interpreted as a function which is expected to accept two arguments (target, source) representing the sub-objects which are about to enter merging. The function will be invoked on these arguments and no further operations will be performed on this subtree. |