Merge pull request #2595 from tugcekucukoglu/datakey
Fixed #2589 - DataTable: support passing a function to the dataKey proppull/2580/head^2
commit
0efbf12857
|
@ -7,7 +7,7 @@ const DataTableProps = [
|
|||
},
|
||||
{
|
||||
name: "dataKey",
|
||||
type: "string",
|
||||
type: "string|function",
|
||||
default: "null",
|
||||
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 DataTableDataKeyType = string | (() => string) | undefined;
|
||||
|
||||
type DataTableMultiSortMetaType = DataTableSortMeta[] | undefined | null;
|
||||
|
||||
type DataTableSortOrderType = 1 | 0 | -1 | undefined | null;
|
||||
|
@ -465,8 +467,9 @@ export interface DataTableProps {
|
|||
value?: any[] | undefined;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -93,7 +93,7 @@ export default {
|
|||
default: null
|
||||
},
|
||||
dataKey: {
|
||||
type: String,
|
||||
type: [String, Function],
|
||||
default: null
|
||||
},
|
||||
rows: {
|
||||
|
|
Loading…
Reference in New Issue