WAF.define('CKEditor', ['waf-core/widget'], function(widget) {
	
	var _this;
	
    var CKEditor = widget.create('CKEditor', {
        init: function() {
        	
        	_this = this;

        	// create editor with CKEditor plugin
        	_this.editor = CKEDITOR.appendTo(_this.node, {
                customConfig: _this.customConfigPath()
            });
        	
//            /* Define a custom event */
//            this.fire('myEvent', {
//                message: 'Hello'
//            });
        },
        content: widget.property({
    		onChange: function(value) {
    			_this.editor.setData(value);
//    			this.node.value = moment(this.dateTime()).format('DD.MM.YYYY HH:mm');
            }
    	}),
    	customConfigPath: widget.property({
    		type: 'string',
    		defaultValue: ''
    	}),
    	getValue: function() {
    		// get editor data
    		return _this.editor.getData();
    	},
    	setValue: function(value) {
    		// set editor data
    		_this.editor.setData(value);
    	}
//        ,
//        /* Create a property */
//        test: widget.property({
//            onChange: function(newValue) {
//                this.node.innerHTML = this.test(); /* this contains the widget and newValue contains its current value */
//            }
//        })
    });

//    /* Map the custom event above to the DOM click event */
//    CKEditor.mapDomEvents({
//        'click': 'action'
//    });

    return CKEditor;

});

/* For more information, refer to http://doc.wakanda.org/Wakanda0.DevBranch/help/Title/en/page3871.html */
@@ -354,24 +354,26 @@
     %7D);%0A
+%0A 
         
 %09%0A//    
@@ -368,126 +368,288 @@
     
-%09%0A//            /* Define a custom event */%0A//            this.fire('myEvent', %7B%0A//                message: 'Hello'%0A//
+   // editor events%0A            _this.editor.on( 'blur', function( e ) %7B                %0A                // set datasource value%0A                _this.content(_this.editor.getData());%0A                // log%0A                console.log('Set datasource value of CKEditor content');%0A
     
@@ -780,87 +780,8 @@
 e);%0A
-//    %09%09%09this.node.value = moment(this.dateTime()).format('DD.MM.YYYY HH:mm');%0A
     
@@ -1096,417 +1096,8 @@
  %09%7D%0A
-//        ,%0A//        /* Create a property */%0A//        test: widget.property(%7B%0A//            onChange: function(newValue) %7B%0A//                this.node.innerHTML = this.test(); /* this contains the widget and newValue contains its current value */%0A//            %7D%0A//        %7D)%0A    %7D);%0A%0A//    /* Map the custom event above to the DOM click event */%0A//    CKEditor.mapDomEvents(%7B%0A//        'click': 'action'%0A//
     

add on blur event to set data source value