-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...k/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from "react"; | ||
import { AdvancedTable } from "playbook-ui"; | ||
import MOCK_DATA from "./advanced_table_mock_data.json"; | ||
|
||
const AdvancedTableColumnHeadersMultiple = (props) => { | ||
const columnDefinitions = [ | ||
{ | ||
accessor: "year", | ||
label: "Year", | ||
cellAccessors: ["quarter", "month", "day"], | ||
}, | ||
{ | ||
label: "Enrollment Data", | ||
columns: [ | ||
{ | ||
label: "Enrollment Stats", | ||
columns: [ | ||
{ | ||
accessor: "newEnrollments", | ||
label: "New Enrollments", | ||
}, | ||
{ | ||
accessor: "scheduledMeetings", | ||
label: "Scheduled Meetings", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Performance Data", | ||
columns: [ | ||
{ | ||
label: "Completion Metrics", | ||
columns: [ | ||
{ | ||
accessor: "completedClasses", | ||
label: "Completed Classes", | ||
}, | ||
{ | ||
accessor: "classCompletionRate", | ||
label: "Class Completion Rate", | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Attendance", | ||
columns: [ | ||
{ | ||
accessor: "attendanceRate", | ||
label: "Attendance Rate", | ||
}, | ||
{ | ||
accessor: "graduatedStudents", | ||
label: "Graduated Students", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
return ( | ||
<div> | ||
<AdvancedTable | ||
columnDefinitions={columnDefinitions} | ||
tableData={MOCK_DATA} | ||
{...props} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AdvancedTableColumnHeadersMultiple; |
1 change: 1 addition & 0 deletions
1
...kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Multiple levels of column headers can also be rendered as seen here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters