Custom components and eventHandlers - bug?

Hi

See http://webix.com/snippet/d317ae07

Here I have made a customization of a datatable. I would like it to have a some custom keyboard-handling.
So I make a custom datatable, using webix.protoUI(). I add a default onKeyPress-handler in the ‘mydt’ component definition.

When using the component without adding further eventhandlers, it will catch the keypresses. See the first datatable in the snippet. Pressing any key in this upper datatable will give a message with the keycode.

The bottom datatable have an onItemDblClick-handler attached. But this seems to completelye overwrite the on:{…} definition set in the custom component.

I think (and hope!) it is a bug, but I cannot see if it is by design.

Check the updated snippet.

http://webix.com/snippet/039d9f2c

It is actually by design, configuration from defaults section is merged with options from the components config. And components config has a higher priority, so the “on” option in the config will replace the “on” config in the defaults section.

Anyway, you can use $init handler in the component to attach any default event handlers

Thank you, works perfectly :slight_smile: