mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Adding 2 missing props on GridProps: rowActionsCell and selectAllRenderer
This commit is contained in:
parent
8cd6bba3b3
commit
e0695202ae
10
types/react-data-grid/index.d.ts
vendored
10
types/react-data-grid/index.d.ts
vendored
@ -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<any> | React.ComponentClass<any> | React.StatelessComponent<any>;
|
||||
/**
|
||||
* A custom formatter for select row column
|
||||
* @default AdazzleReactDataGridPlugins.Editors.CheckboxEditor
|
||||
*/
|
||||
rowActionsCell?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>;
|
||||
/**
|
||||
* An event function called when a row is clicked.
|
||||
* Clicking the header row will trigger a call with -1 for the rowIdx.
|
||||
|
||||
@ -31,6 +31,35 @@ class CustomFilterHeaderCell extends React.Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
class CustomRowSelectorCell extends ReactDataGridPlugins.Editors.CheckboxEditor {
|
||||
render(){
|
||||
return super.render();
|
||||
}
|
||||
}
|
||||
|
||||
export interface ICustomSelectAllProps {
|
||||
onChange: any;
|
||||
inputRef: any;
|
||||
}
|
||||
|
||||
class CustomSelectAll extends React.Component<ICustomSelectAllProps> {
|
||||
render() {
|
||||
return (
|
||||
<div className='react-grid-checkbox-container checkbox-align'>
|
||||
<input
|
||||
className='react-grid-checkbox'
|
||||
type='checkbox'
|
||||
name='select-all-checkbox'
|
||||
id='select-all-checkbox'
|
||||
ref={this.props.inputRef}
|
||||
onChange={this.props.onChange}
|
||||
/>
|
||||
<label htmlFor='select-all-checkbox' className='react-grid-checkbox-label'></label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
faker.locale = 'en_GB';
|
||||
|
||||
function createFakeRowObjectData(index:number):Object {
|
||||
@ -327,6 +356,8 @@ class Example extends React.Component<any, any> {
|
||||
keys: {rowKey: 'id', values: selectedRows}
|
||||
}
|
||||
}}
|
||||
rowActionsCell={CustomRowSelectorCell}
|
||||
selectAllRenderer={CustomSelectAll}
|
||||
onRowClick={this.onRowClick}
|
||||
/>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user