Add clear button and autoscroll to table
Reviewed By: lblasa Differential Revision: D48600634 fbshipit-source-id: 4ccf82314e3ef3c7466e91e8c181f35ee264bc0a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c7ad98cba4
commit
3fcb932f28
@@ -7,7 +7,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {PartitionOutlined} from '@ant-design/icons';
|
import {DeleteOutlined, PartitionOutlined} from '@ant-design/icons';
|
||||||
import {
|
import {
|
||||||
DataTable,
|
DataTable,
|
||||||
DataTableColumn,
|
DataTableColumn,
|
||||||
@@ -84,11 +84,13 @@ export function FrameworkEventsTable({
|
|||||||
return (
|
return (
|
||||||
<Layout.Container grow>
|
<Layout.Container grow>
|
||||||
<DataTable<FrameworkEvent>
|
<DataTable<FrameworkEvent>
|
||||||
|
enableAutoScroll
|
||||||
dataSource={instance.frameworkEvents}
|
dataSource={instance.frameworkEvents}
|
||||||
tableManagerRef={managerRef}
|
tableManagerRef={managerRef}
|
||||||
onSelect={onSelectRow}
|
onSelect={onSelectRow}
|
||||||
columns={allColumns}
|
columns={allColumns}
|
||||||
extraActions={
|
extraActions={
|
||||||
|
<>
|
||||||
<Tooltip title="Back to tree">
|
<Tooltip title="Back to tree">
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -97,6 +99,15 @@ export function FrameworkEventsTable({
|
|||||||
}}
|
}}
|
||||||
icon={<PartitionOutlined />}></Button>
|
icon={<PartitionOutlined />}></Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
<Tooltip title="Delete all events">
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
instance.frameworkEvents.clear();
|
||||||
|
managerRef.current?.clearSelection();
|
||||||
|
}}
|
||||||
|
icon={<DeleteOutlined />}></Button>
|
||||||
|
</Tooltip>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<DetailSidebar width={450}>
|
<DetailSidebar width={450}>
|
||||||
|
|||||||
Reference in New Issue
Block a user