The component id of the current view instance.
SERVICES
The configuration of the component to render.
The rendered HTML of the view.
The configuration of the view to render.
The viewFields of the view.
Sets the hide condition on context manager field(s). The hide condition cannot be configured on a context manager field which is configured to be hidden. When specifying a component id, that component is targeted, otherwise the current context in which the function is called will be taken. The condition will be checked when an interaction in the context manager is made. (loadComplete, value changed, refresh, ...). Because this is extra configuration on the context manager, the most logical place to call this function is in the configuration script.
CSL.contextManager.addHideFieldCondition((rowData) => {
return rowData.productActive;
}, ['productName'], componentId);
The condition that returns a boolean that indicates whether the field needs to be hidden.
The names of the context manager fields to set the condition on.
Optional
componentId: stringThe id of the component.
Removes the hide condition on context manager field. If the field is configured as 'hidden' the field will always be hidden. When specifying a component id, that component is targeted, otherwise the current context in which the function is called will be taken.
CSL.contextManager.removeHideFieldCondition(['productName', 'productDescription'], componentId);
The names of the context manager fields to set the condition on.
Optional
componentId: stringThe id of the component.
Sets the given context as context. Overrides if the key of a field was allready in use.
// Set for the field 'name' the value 'John' in context.
CSL.contextManager.setContextValue('name', 'John');
// Set an object as context.
CSL.contextManager.setContextValue({'name': 'John', 'age': 35});
// Set for the 'name' field the value 'John' in context, without triggering the context change event.
CSL.contextManager.setContextValue('name', 'John', false);
The context to set or the key of the context.
Optional
contextValue: anyThe value for the key.
The conditional to emit context change event or not. Leaving this parameter to its default value or setting it to true will remain as it used to be, meaning the ADM will refresh itself if it's listening to the context manager.
Gets or sets the values of the context manager component. The context manager's search will also be triggered and the context will be set when the search button is not visible. Best practice is to set values of the correct type for the control. For example a number for a number field, a date for a date field, ... We will try to parse the 'incorrect' value to the correct type, but we can not guarantee the correct value will be set.
CSL.contextManager.values(); // Returns all values of the form
CSL.contextManager.values({'name': 'John', 'stock': 500, 'delivery': new Date('4-27-2020'), 'isActive': true}, undefined, 'a35b'); // Returns all values of the form after setting values.
CSL.contextManager.values({'name': 'John'}, ['name', 'stock'], componentId); // Returns the values for 'name' and 'stock' after setting value for 'name'
Optional
valuesToSet: { Optional
viewFieldNames: string[]Optional
componentId: stringGenerated using TypeDoc
This class supports the functionality for custom scripting on a context manager. You can access all the methods by using the namespace
CSL.contextManager
.