Events customisation for the grid cell
komarovalexander
released this
12 Jan 10:25
·
1222 commits
to master
since this release
childAttributes prop was added for grid cell events customisation
Demo: Events
const childAttributes: ChildAttributes = {
cell: {
className: '123',
onClick: (e, extendedEvent): any => {
const { childProps: { dispatch } } = extendedEvent;
dispatch('MY_CELL_onClick', { extendedEvent });
},
onContextMenu: (e, extendedEvent) => {
extendedEvent.dispatch('MY_CELL_onContextMenu', { extendedEvent });
},
onDoubleClick: (e, extendedEvent) => {
const { dispatch, childElementAttributes } = extendedEvent;
childElementAttributes.onClick?.(e);
dispatch('MY_CELL_onDoubleClick', { extendedEvent });
},
},
};
return <Table ... childAttributes={childAttributes}>