Fixed #2589 - DataTable: support passing a function to the dataKey prop
parent
bb6dcfb7d3
commit
8e632d93ac
|
@ -7,7 +7,7 @@ const DataTableProps = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "dataKey",
|
name: "dataKey",
|
||||||
type: "string",
|
type: "string|function",
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Name of the field that uniquely identifies the a record in the data."
|
description: "Name of the field that uniquely identifies the a record in the data."
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,6 +7,8 @@ type DataTablePaginatorPositionType = 'top' | 'bottom' | 'both' | undefined;
|
||||||
|
|
||||||
type DataTableSortFieldType = string | ((item: any) => string) | undefined;
|
type DataTableSortFieldType = string | ((item: any) => string) | undefined;
|
||||||
|
|
||||||
|
type DataTableDataKeyType = string | (() => string) | undefined;
|
||||||
|
|
||||||
type DataTableMultiSortMetaType = DataTableSortMeta[] | undefined | null;
|
type DataTableMultiSortMetaType = DataTableSortMeta[] | undefined | null;
|
||||||
|
|
||||||
type DataTableSortOrderType = 1 | 0 | -1 | undefined | null;
|
type DataTableSortOrderType = 1 | 0 | -1 | undefined | null;
|
||||||
|
@ -465,8 +467,9 @@ export interface DataTableProps {
|
||||||
value?: any[] | undefined;
|
value?: any[] | undefined;
|
||||||
/**
|
/**
|
||||||
* Name of the field that uniquely identifies the a record in the data.
|
* Name of the field that uniquely identifies the a record in the data.
|
||||||
|
* @see DataTableDataKeyType
|
||||||
*/
|
*/
|
||||||
dataKey?: string | undefined;
|
dataKey?: DataTableDataKeyType;
|
||||||
/**
|
/**
|
||||||
* Number of rows to display per page.
|
* Number of rows to display per page.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -93,7 +93,7 @@ export default {
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
dataKey: {
|
dataKey: {
|
||||||
type: String,
|
type: [String, Function],
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
rows: {
|
rows: {
|
||||||
|
|
Loading…
Reference in New Issue