[ARVADOS-WORKBENCH2] created: 1.1.4-99-g6f12d4b
Git user
git at public.curoverse.com
Mon Jun 18 09:09:01 EDT 2018
at 6f12d4bae0571b94ade65f0c0a1423056c8dc253 (commit)
commit 6f12d4bae0571b94ade65f0c0a1423056c8dc253
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Jun 18 15:08:52 2018 +0200
Add table row mouse event handling props
Feature #13634
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx
index e7ce03a..ec260e9 100644
--- a/src/components/data-table/data-table.tsx
+++ b/src/components/data-table/data-table.tsx
@@ -9,12 +9,13 @@ import { DataColumn } from './data-column';
export interface DataTableProps<T> {
items: T[];
columns: Array<DataColumn<T>>;
- onItemClick?: (item: T) => void;
+ onRowClick?: (event: React.MouseEvent<HTMLTableRowElement>, item: T) => void;
+ onRowContextMenu?: (event: React.MouseEvent<HTMLTableRowElement>, item: T) => void;
}
class DataTable<T> extends React.Component<DataTableProps<T> & WithStyles<CssRules>> {
render() {
- const { items, columns, classes, onItemClick } = this.props;
+ const { items, columns, classes, onRowClick, onRowContextMenu } = this.props;
return <div className={classes.tableContainer}>
{items.length > 0 ?
<Table>
@@ -35,7 +36,8 @@ class DataTable<T> extends React.Component<DataTableProps<T> & WithStyles<CssRul
<TableRow
hover
key={index}
- onClick={() => onItemClick && onItemClick(item)}>
+ onClick={event => onRowClick && onRowClick(event, item)}
+ onContextMenu={event => onRowContextMenu && onRowContextMenu(event, item)}>
{columns
.filter(column => column.selected)
.map((column, index) => (
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list