CodeCoupler UI DataSource Mixin "Extended Fields"
Part of the
CodeCoupler UI Pro package.
A DataSource Mixin providing an extended model definition. In addition to the basic field
defaultValue etc. the following properties can be used:
The given value will always be set for this field. Using this property the properties
defaultValuecannot be used.
from, but it preprocess the response and set the value of the field to
nullif not defined. If you use just
fromthe datasource would throw an error if this target field do not exist in the response. The reference in sub-objects is supported (string can be
a.b.fieldfor example). If you are using
schema.dataas a function you must know that these fields will be created after executing your function.
calculated: Function(value,dataItem,args) || [ function, args ]
The function receives (in contrast to
parse) additionally the whole item received from the server. You can calculate on that base and return any value the field should get. The function will receive the value of the field if this exists. Otherwise
valuewill be "undefined". You can set an array with first argument the function and as second argument any value that will be passed to the function as third parameter. Do not use this with
optionalFromas the value will be set from these fields. If you are using
schema.dataas a function you must know that your function will be called first.