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
configuration properties type
, defaultValue
etc. the following properties can be used:
constant
: Any-
The given value will always be set for this field. Using this property the properties
parse
anddefaultValue
cannot be used. optionalFrom
: String-
Like
from
, but it preprocess the response and set the value of the field tonull
if not defined. If you use justfrom
the datasource would throw an error if this target field do not exist in the response. The reference in sub-objects is supported (string can bea.b.field
for example). If you are usingschema.data
as 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. Otherwisevalue
will 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 withfrom
oroptionalFrom
as the value will be set from these fields. If you are usingschema.data
as a function you must know that your function will be called first.