Skip to content

Commit 9bce4c7

Browse files
authored
Merge pull request #2093 from dxc-technology/jialecl-dataGrid-doc
Complete data grid documentation
2 parents ab373ef + 8691b99 commit 9bce4c7

File tree

16 files changed

+1017
-36
lines changed

16 files changed

+1017
-36
lines changed

apps/website/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

apps/website/screens/components/data-grid/DatagridPageLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import ComponentHeading from "@/common/ComponentHeading";
66
const DataGridPageHeading = ({ children }: { children: React.ReactNode }) => {
77
const tabs = [
88
{ label: "Code", path: "/components/data-grid" },
9-
// { label: "Usage", path: "/components/data-grid/usage" },
10-
// { label: "Specifications", path: "/components/data-grid/specifications" },
9+
{ label: "Usage", path: "/components/data-grid/usage" },
10+
{ label: "Specifications", path: "/components/data-grid/specifications" },
1111
];
1212

1313
return (

apps/website/screens/components/data-grid/code/DataGridCodePage.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const sections = [
8787
<b>summaryKey</b>: Value that will be rendered from the <TableCode>summaryRow</TableCode>
8888
</li>
8989
<li>
90-
<b>alignment</b>: St sets the alignment inside the cells.
90+
<b>alignment</b>: Sets the alignment inside the cells.
9191
</li>
9292
</ul>
9393
</td>
@@ -174,6 +174,14 @@ const sections = [
174174
</td>
175175
<td>-</td>
176176
</tr>
177+
<tr>
178+
<td>onGridRowsChange</td>
179+
<td>
180+
<TableCode>{`(rows: GridRow[] | HierarchyGridRow[] | ExpandableGridRow[]) => void`}</TableCode>
181+
</td>
182+
<td>Function called whenever a cell is edited.</td>
183+
<td>-</td>
184+
</tr>
177185
</tbody>
178186
</DxcTable>
179187
),

apps/website/screens/components/data-grid/code/examples/basicUsage.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ const code = `() => {
1313
label: "% Complete",
1414
resizable: true,
1515
draggable: true,
16-
alignment: "center",
16+
alignment: "right",
1717
},
1818
];
1919
2020
const rows = [
2121
{
22-
id: 1,
22+
id: "Row 1",
2323
complete: 46,
2424
},
2525
{
26-
id: 2,
26+
id: "Row 2",
2727
complete: 51,
2828
},
2929
{
30-
id: 3,
30+
id: "Row 3",
3131
complete: 40,
3232
},
3333
{
34-
id: 4,
34+
id: "Row 4",
3535
complete: 10,
3636
},
37-
3837
];
38+
3939
return (
4040
<DxcInset space="2rem">
4141
<DxcDataGrid columns={columns} rows={rows} uniqueRowId="id" />

apps/website/screens/components/data-grid/code/examples/expandable.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@ const code = `() => {
1313
label: "% Complete",
1414
resizable: true,
1515
draggable: true,
16-
alignment: "center",
16+
alignment: "right",
1717
},
1818
];
1919
2020
const rows = [
2121
{
22-
id: 1,
22+
id: "Row 1",
2323
complete: 46,
2424
expandedContent: "Expanded content"
2525
},
2626
{
27-
id: 2,
27+
id: "Row 2",
2828
complete: 51,
2929
expandedContent: "Expanded content",
3030
expandedContentHeight: 100
3131
},
3232
{
33-
id: 3,
33+
id: "Row 3",
3434
complete: 40,
3535
},
3636
{
37-
id: 4,
37+
id: "Row 4",
3838
complete: 10,
3939
},
40-
4140
];
41+
4242
return (
4343
<DxcInset space="2rem">
4444
<DxcDataGrid columns={columns} rows={rows} expandable uniqueRowId="id" />

apps/website/screens/components/data-grid/code/examples/hierarchical.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const code = `() => {
1010
{
1111
key: "value",
1212
label: "Value",
13-
alignment: "center",
13+
alignment: "right",
1414
summaryKey: "total"
1515
},
1616
];

apps/website/screens/components/data-grid/code/examples/hierarchicalSelectable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const code = `() => {
1111
{
1212
key: "value",
1313
label: "Value",
14-
alignment: "center",
14+
alignment: "right",
1515
summaryKey: "total"
1616
},
1717
];

apps/website/screens/components/data-grid/code/examples/selectable.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,27 @@ const code = `() => {
1414
label: "% Complete",
1515
resizable: true,
1616
draggable: true,
17-
alignment: "center",
17+
alignment: "right",
1818
},
1919
];
2020
2121
const rows = [
2222
{
23-
id: 1,
23+
id: "Row 1",
2424
complete: 46,
2525
},
2626
{
27-
id: 2,
27+
id: "Row 2",
2828
complete: 51,
2929
},
3030
{
31-
id: 3,
31+
id: "Row 3",
3232
complete: 40,
3333
},
3434
{
35-
id: 4,
35+
id: "Row 4",
3636
complete: 10,
3737
},
38-
3938
];
4039
4140
const [selectedRows, setSelectedRows] = useState(new Set());

0 commit comments

Comments
 (0)