ka-table v2.2.4 Release Notes

Release Date: 2020-01-12 // over 4 years ago
  • 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}>