Sha256: 57e9bd91a2ac59cde7c40b2931c7db1e56e565c015b7022325eed9e3b57c3e53

Contents?: true

Size: 1.6 KB

Versions: 267

Compression:

Stored size: 1.6 KB

Contents

<%
  column_definitions = [
    {
      accessor: "year",
      label: "Year",
      cellAccessors: ["quarter", "month", "day"],
      custom_renderer: ->(row, value) {
        capture do
          pb_rails("flex") do
            pb_rails("title", props: { text: value, size: 4 }) +
            pb_rails("badge", props: { dark: true, margin_left: "xxs", text: row[:newEnrollments].to_i > 20 ? "High" : "Low", variant: "neutral" })
          end
        end
      }
    },
    {
      accessor: "newEnrollments",
      label: "New Enrollments",
      custom_renderer: ->(row, value) { pb_rails("pill", props: { text: value, variant: "success" }) }
    },
    {
      accessor: "scheduledMeetings",
      label: "Scheduled Meetings",
      custom_renderer: ->(row, value) { content_tag(:a, value, href: "#") }
    },
    {
      accessor: "attendanceRate",
      label: "Attendance Rate",
      custom_renderer: ->(row, value) {
        capture do
          pb_rails("flex", props: { align_items: "end", orientation: "column" }) do
            pb_rails("detail", props: { bold: true, color: "default", text: value }) +
            pb_rails("caption", props: { size: "xs", text: row[:graduatedStudents] })
          end
        end
      }
    },
    {
      accessor: "completedClasses",
      label: "Completed Classes",
    },
    {
      accessor: "classCompletionRate",
      label: "Class Completion Rate",
    },
    {
      accessor: "graduatedStudents",
      label: "Graduated Students",
    }
  ]
%>

<%= pb_rails("advanced_table", props: { id: "custom_cell", table_data: @table_data, column_definitions: column_definitions }) %>

Version data entries

267 entries across 267 versions & 2 rubygems

Version Path
playbook_ui_docs-14.10.0.pre.rc.1 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.10.0.pre.rc.1 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.alpha.PBNTR686advancedtablepaginationpoc4747 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.alpha.PBNTR686advancedtablepaginationpoc4747 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.alpha.pbntr700newresettodefaultprop4736 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.alpha.pbntr700newresettodefaultprop4736 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.10.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.10.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.18 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.rc.18 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.17 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.rc.17 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.16 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.rc.16 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.15 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.rc.15 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.14 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui-14.9.0.pre.rc.14 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb
playbook_ui_docs-14.9.0.pre.rc.13 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb