Add defaultSort property to reactable.Table (#30531)

This commit is contained in:
Lars-Olof Moilanen 2018-11-15 21:59:34 +01:00 committed by Pranav Senthilnathan
parent 33f6ddabc9
commit 615629e8f9
2 changed files with 4 additions and 1 deletions

View File

@ -13,12 +13,15 @@ export interface KeyLabelObject {
export type ColumnsType = string | KeyLabelObject;
export type SortDirection = 'asc' | 'desc';
export type FilterMethodType = (text: string) => void;
export interface TableComponentProperties<T> {
data?: T[];
className?: string;
columns?: ColumnsType[];
defaultSort?: { column: string, direction: SortDirection };
id?: string;
sortable?: string[];
filterable?: string[];

View File

@ -65,7 +65,7 @@ export class FullblownReactableTestComponent extends React.Component {
);
}
return (
<PersonTable>
<PersonTable defaultSort={{ column: "name", direction: 'asc' }}>
<PersonTableHeader>
{columns}
</PersonTableHeader>