dist/jscow.js
function (event, d, l) {
		
		var config = this.cmp().config();
		var data = d;
		var local = l;

		if (typeof d === 'undefined' || !d) {
			data = config;
		}else if (typeof d === 'object') {
			data = d;
		}else{
			data = {};
		}
		
		if (data) {
			
			var self = this;
			
			if (typeof local === 'undefined' || !local) {
				local = this.cmp(); 
			} else {
				local = false;
			}

			if (jsCow.events[event] !== undefined) {
				$.each(jsCow.events[event], (function(self, event, data, local) {
					return function (i, e) {
						
						if (typeof local === "object" && local.id() === e.sender.id() && e.local) {
							
							setTimeout(
								function() {
									
									if (jsCow.debug.events) {
										console.log("local :: trigger event ", "'"+e.event+"'", "from", "'"+self.cmp().id()+"' for '"+e.that.id()+"'.");
									}

									e.handler.apply(e.that, [{ 
										data: data,
										sender: self.cmp(),
										date: new Date()
									}]);
								}, 0
							);
							
						} else if (self.isNot(local) === e.local) {
							
							setTimeout(
								function() {
									
									if (jsCow.debug.events) {
										console.log("global :: trigger even", "'"+e.event+"'", "from", "'"+self.cmp().id()+"' for '"+e.that.id()+"'.");
									}

									e.handler.apply(e.that, [{ 
										data: data,
										sender: self.cmp(),
										date: new Date()
									}]);

								}, 0
							);
							
						}
						
					};
				})(self, event, data, local));
			}
			
		}
		
		return this;
	}
function (event, d, l) {
		
		var config = this.cmp().config();
		var data = d;
		var local = l;

		if (typeof d === 'undefined' || !d) {
			data = config;
		}else if (typeof d === 'object') {
			data = d;
		}else{
			data = {};
		}
		
		if (data) {
			
			var self = this;
			
			if (typeof local === 'undefined' || !local) {
				local = this.cmp(); 
			} else {
				local = false;
			}

			if (jsCow.events[event] !== undefined) {
				$.each(jsCow.events[event], (function(self, event, data, local) {
					return function (i, e) {
						
						if (typeof local === "object" && local.id() === e.sender.id() && e.local) {
							
							setTimeout(
								function() {
									
									if (jsCow.debug.events) {
										console.log("local :: trigger event ", "'"+e.event+"'", "from", "'"+self.cmp().id()+"' for '"+e.that.id()+"'.");
									}

									e.handler.apply(e.that, [{ 
										data: data,
										sender: self.cmp(),
										date: new Date()
									}]);
								}, 0
							);
							
						} else if (self.isNot(local) === e.local) {
							
							setTimeout(
								function() {
									
									if (jsCow.debug.events) {
										console.log("global :: trigger even", "'"+e.event+"'", "from", "'"+self.cmp().id()+"' for '"+e.that.id()+"'.");
									}

									e.handler.apply(e.that, [{ 
										data: data,
										sender: self.cmp(),
										date: new Date()
									}]);

								}, 0
							);
							
						}
						
					};
				})(self, event, data, local));
			}
			
		}
		
		return this;
	}
function ( event , d , l ) { var config = this . cmp ( ) . config ( ) ; var data = d ; var local = l ; if ( typeof d === 'undefined' || ! d ) { data = config ; } else if ( typeof d === 'object' ) { data = d ; } else { data = { } ; } if ( data ) { var self = this ; if ( typeof local === 'undefined' || ! local ) { local = this . cmp ( ) ; } else { local = false ; } if ( jsCow . events [ event ] !== undefined ) { $ . each ( jsCow . events [ event ] , ( function ( self , event , data , local ) { return function ( i , e ) { if ( typeof local === "object" && local . id ( ) === e . sender . id ( ) && e . local ) { setTimeout ( function ( ) { if ( jsCow . debug . events ) { console . log ( "local :: trigger event " , "'" + e . event + "'" , "from" , "'" + self . cmp ( ) . id ( ) + "' for '" + e . that . id ( ) + "'." ) ; } e . handler . apply ( e . that , [ { data : data , sender : self . cmp ( ) , date : new Date ( ) } ] ) ; } , 0 ) ; } else if ( self . isNot ( local ) === e . local ) { setTimeout ( function ( ) { if ( jsCow . debug . events ) { console . log ( "global :: trigger even" , "'" + e . event + "'" , "from" , "'" + self . cmp ( ) . id ( ) + "' for '" + e . that . id ( ) + "'." ) ; } e . handler . apply ( e . that , [ { data : data , sender : self . cmp ( ) , date : new Date ( ) } ] ) ; } , 0 ) ; } } ; } ) ( self , event , data , local ) ) ; } } return this ; }
Trigger an attached event.
@method trigger
@param {String} event Defines the name of the attached event
@param {Object} d Defines the event data by trigger the attached event.
@param {Boolean} l Defines the type (local or global) of the event.
@return {Object} Returns the reference to the current event handler.
@chainable
Trigger an attached event .