Sha256: eb5f012dc05b501f1989643a63e6b3468638475f8378c0c75c88a4b904d7cdbf

Contents?: true

Size: 1.31 KB

Versions: 20

Compression:

Stored size: 1.31 KB

Contents

import React, { useState } from "react"
import { AdvancedTable } from "../../"
import { MOCK_DATA } from "./_mock_data"

const AdvancedTableExpandedControl = (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",
    },
  ]

  //State for manually effecting what is expanded
  const [expanded, setExpanded] = useState({'0': true, '0.0': true, '0.0.1': true})

  //Passing expanded state to AdvancedTable as prop
  const expandedControl = {
    value: expanded,
    onChange: setExpanded,
  }

  return (
    <div>
      <AdvancedTable
          columnDefinitions={columnDefinitions}
          expandedControl={expandedControl}
          tableData={MOCK_DATA}
          {...props}
      />
    </div>
  )
}

export default AdvancedTableExpandedControl

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.22.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.22.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582474 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582474 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY120322465 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PLAY120322465 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui_docs-13.20.0.pre.alpha.PBNTR225advancedtablefeedback2375 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx
playbook_ui-13.20.0.pre.alpha.PBNTR225advancedtablefeedback2375 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx