# onClick

### Description

@short: Fires when the user clicks the left mouse button on an event

@signature: onClick: (id: string, e: Event) =\> boolean;

### Parameters

- `id` - (required) *string* - the event's id
- `e` - (required) *Event* - a native event object

### Returns
- ` result` - (boolean) - defines whether the default action of the event will be triggered (<b>true</b>) or canceled (<b>false</b>)

### Example

~~~jsx
scheduler.attachEvent("onClick", function (id, e){
       //any custom logic here
       return true;
  });
~~~

### Related samples
- [Hiding the select bar of the event box](https://docs.dhtmlx.com/scheduler/samples/02_customization/10_without_toolbar.html)
- [Read-only lightbox](https://docs.dhtmlx.com/scheduler/samples/03_extensions/12_readonly_form.html)

### Details

The event is blockable. If non-true value is returned from the handler, the default reaction will be blocked ( by default, the selection bar appears).

### Related Guides
- [Manipulations with Lightbox](guides/lightbox-editors-manipulations.md#opening-the-lightbox-on-a-single-click)
