OnControlEvent

This API runs the event handler call up to the presentation model and subsequently any custom event handlers that may be attached to the event.

The following example shows the usage of APIs in a custom event handler on a custom plug-in wrapper. It depicts a method that is executed on the presentation model, the return value determines if the event should be handled or ignored:

function OnClick(evt) {   
// This is a custom click handler for my control.   
var self = evt.data.ctx,   
shouldHonorClick = self.ExecuteMethod("CustomPMMethod");   
if (shouldHonorClick) {   
 self.OnControlEvent("customClickEvent", self.control, self.dataset);   
}   
}