diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts index af6edce257..f66aad2e41 100644 --- a/types/react-data-grid/index.d.ts +++ b/types/react-data-grid/index.d.ts @@ -203,6 +203,16 @@ declare namespace AdazzleReactDataGrid { isSelectedKey?: string; } } + /** + * A custom formatter for the select all checkbox cell + * @default react-data-grid/src/formatters/SelectAll.js + */ + selectAllRenderer?: React.ReactElement | React.ComponentClass | React.StatelessComponent; + /** + * A custom formatter for select row column + * @default AdazzleReactDataGridPlugins.Editors.CheckboxEditor + */ + rowActionsCell?: React.ReactElement | React.ComponentClass | React.StatelessComponent; /** * An event function called when a row is clicked. * Clicking the header row will trigger a call with -1 for the rowIdx. diff --git a/types/react-data-grid/react-data-grid-tests.tsx b/types/react-data-grid/react-data-grid-tests.tsx index 827e20c820..8c0feb8f64 100644 --- a/types/react-data-grid/react-data-grid-tests.tsx +++ b/types/react-data-grid/react-data-grid-tests.tsx @@ -31,6 +31,35 @@ class CustomFilterHeaderCell extends React.Component { } } +class CustomRowSelectorCell extends ReactDataGridPlugins.Editors.CheckboxEditor { + render(){ + return super.render(); + } +} + +export interface ICustomSelectAllProps { + onChange: any; + inputRef: any; +} + +class CustomSelectAll extends React.Component { + render() { + return ( +
+ + +
+ ); + } +} + faker.locale = 'en_GB'; function createFakeRowObjectData(index:number):Object { @@ -327,6 +356,8 @@ class Example extends React.Component { keys: {rowKey: 'id', values: selectedRows} } }} + rowActionsCell={CustomRowSelectorCell} + selectAllRenderer={CustomSelectAll} onRowClick={this.onRowClick} />