assert

if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen

void assert(boolean expression,string errorMessage);

Parameters

expressionbooleantrue to assert the expression, false - if assertion fails
errorMessagestringan error message that will be shown in the red popup

Example

scheduler.attachEvent("onLoadEnd", function(){
   scheduler.assert(scheduler.getTaskCount(), "no data loaded");
});

Details

dhtmlxScheduler codebase uses scheduler.assert() to detect an invalid state of the component.

Error display can be changed using the show_errors config.

Errors can be traced programmatically, using the onError event.

Change log

added in v6.0

Back to top