Skip to content

Commit

Permalink
Documentation for controlled datatable rowdetails PR grommet/grommet#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aheintz committed Jul 2, 2023
1 parent e22ac41 commit 31dfe40
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions src/screens/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,31 @@ const DataTablePage = () => (

<Property name="rowDetails">
<Description>
When supplied, this function will be called with row data. Function
can return a React Element which will be rendered on expanding the
row.
Function rendering the row details or an object to manage row
details controlled.
</Description>
<PropertyValue type="function">
<Example>{`() => {}`}</Example>
<Example>{`(row) => { return <span>Row Details</span>}`}</Example>
</PropertyValue>
<PropertyValue type="object">
<Description>
You can enable controlled row details by providing an object with
the properties `render` (function rendering row details),
`expanded` (function returning `true` if the row should be
expanded.), `expandable` (function returning `true` if the row is
expandable), and `onClickExpand` (when supplied, this function
will be called when user clicks expand button. Clicked `row`
object is provided as argument).
</Description>
<Example>
{`
{
render: (row) => {...} // return React Element
expanded: (row) => {...} // return boolean
expandable: (row) => {...} // return boolean
onClickExpand: (row) => {...} // void
}`}
</Example>
</PropertyValue>
</Property>

Expand Down Expand Up @@ -804,7 +823,7 @@ const DataTablePage = () => (
opacity: bool | string,
repeat: no-repeat | repeat,
size: cover | contain | string
}
}
`}
</Example>
</PropertyValue>
Expand All @@ -823,7 +842,7 @@ const DataTablePage = () => (
size: "medium",
style: "dashed",
side: "all"
}
}
`}
</Example>
</PropertyValue>
Expand Down Expand Up @@ -882,7 +901,7 @@ const DataTablePage = () => (
opacity: bool | string,
repeat: no-repeat | repeat,
size: cover | contain | string
}
}
`}
</Example>
</PropertyValue>
Expand Down Expand Up @@ -995,7 +1014,7 @@ const DataTablePage = () => (
opacity: bool | string,
repeat: no-repeat | repeat,
size: cover | contain | string
}
}
`}
</Example>
</PropertyValue>
Expand Down Expand Up @@ -1025,7 +1044,7 @@ const DataTablePage = () => (
opacity: bool | string,
repeat: no-repeat | repeat,
size: cover | contain | string
}
}
`}
</Example>
</PropertyValue>
Expand Down Expand Up @@ -1055,7 +1074,7 @@ const DataTablePage = () => (
opacity: bool | string,
repeat: no-repeat | repeat,
size: cover | contain | string
}
}
`}
</Example>
</PropertyValue>
Expand Down

0 comments on commit 31dfe40

Please sign in to comment.