Frontend services can be used to get and set attributes and values of UI elements.
csArrayDataManager
The csArrayDataManager
is a service of the csQueryDataManager
factory. This service is used to generate content based on an array for csVirtualListRenderer
item renderer. Optionally it's possible to group result items.
Methods
csArrayDataManager constructor
Inject csArrayDataManager
into your code (usually into WidgetDataManager) and call it.
Optionally it is possible to set readers of type csReader of result observable and groups observable.
//creating csArrayDataManager var dataSource = new csArrayDataManager(); or //result and groups provided as csReader var dataSource = new csArrayDataManager(resultReader, groupsReader);
resultReader: csReader
Reader for result observable.
groupsReader: csReader
Reader for groups observable.
totalCountReader: csReader
Reader for total amount of results to observable.
viewLimitReader: csReader
Reader for view limit observable. View limit represent maximal amount of items shown.
offsetReader: csReader
Reader for current offset observable, which represent the first array element index visible for current view.
destroy()
It destroys csArrayDataManager object and observables created by the object.
clear()
It sets an empty array to result observable.
setViewLimit(newViewLimit)
It sets a new value to view limit observable.
setOffset(newOffset)
It sets a new value to offset observable.
setValues(any[])
It sets values to result observable and updates total amount observable.
csDefaultModalActions
The default dialog actions are available in modal-window.component.ts
as class DefaultDialogActions
or as service csDefaultModalActions
. They are the replacement of the old deprecated default dialog actions defined in the csDefaultDialogActions
.
Methods
The current available default actions:
submit()
It performs a custom callback to the safeAndCloseDialog
function of dialogManager.
this.submit = actionFactory .customCallbackAction(this.dialogManager.safeAndCloseDialog, this.submitViewFactory) .setTitle('csCommonTranslations.ok');
close()
It performs a custom callback to the closeDialog
function of dialogManager.
this.close = actionFactory .action(this.dialogManager.closeDialog) .setTitle('csCommonTranslations.cancel');
csNotify
csNotify
is a service which is used to give some notifications to user/get confirmation.
Dialogs
Confirmation dialog
csNotify.confirm(pageInstance, 'Confirm please', 'Do you really want to continue').then( function () { // console.log('---- clicked OK ----'); }, function () { // console.log('---- clicked CANCEL ----'); } );
Error dialog
csNotify.error('This is an error', 'Message for the error').then( function () { // console.log('---- clicked OK ----'); } );
Dialog
csNotify.dialog(pageInstance, 'This is a dialog', 'Message for dialog');
Notifications
Information
csNotify.info('This is an info', 'Message for the info');
Warning
csNotify.warning('This is a warning', 'Message for the warning');
Failue
csNotify.failure('This is a failure', 'Message for the failure');
Success
csNotify.success('This is a success', 'Message for success');
System notification
csNotify.localNotify('Hello', 'Got a message from censhare');