Sha256: f46e0fb6cff0a878015d7bad309a82f5bbd1f9152e3800102379db9559f7c25c
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 KB
Contents
import React from "react" import { AdvancedTable } from "playbook-ui" import MOCK_DATA from "./advanced_table_mock_data_with_id.json" const AdvancedTableSelectableRows = (props) => { const columnDefinitions = [ { accessor: "year", label: "Year", cellAccessors: ["quarter", "month", "day"], }, { accessor: "newEnrollments", label: "New Enrollments", }, { accessor: "scheduledMeetings", label: "Scheduled Meetings", }, { accessor: "attendanceRate", label: "Attendance Rate", }, { accessor: "completedClasses", label: "Completed Classes", }, { accessor: "classCompletionRate", label: "Class Completion Rate", }, { accessor: "graduatedStudents", label: "Graduated Students", }, ] //Render the subRow header rows const subRowHeaders = ["Quarter", "Month", "Day"] return ( <div> <AdvancedTable columnDefinitions={columnDefinitions} enableToggleExpansion="all" onRowSelectionChange={(selectedRows) => console.log(selectedRows)} selectableRows tableData={MOCK_DATA} {...props} > <AdvancedTable.Header /> <AdvancedTable.Body subRowHeaders={subRowHeaders}/> </AdvancedTable> </div> ) } export default AdvancedTableSelectableRows
Version data entries
2 entries across 2 versions & 2 rubygems