|
Year
|
New Enrollments
|
Scheduled Meetings
|
Attendance Rate
|
Completed Classes
|
Class Completion Rate
|
Graduated Students
|
|---|---|---|---|---|---|---|
|
2021
|
20
|
10
|
51%
|
3
|
33%
|
19
|
|
Q1
|
2
|
35
|
32%
|
15
|
52%
|
36
|
|
January
|
16
|
20
|
11%
|
13
|
47%
|
28
|
|
10
|
34
|
28
|
97%
|
20
|
15%
|
17
|
|
20
|
43
|
23
|
66%
|
26
|
47%
|
9
|
|
February
|
20
|
41
|
95%
|
26
|
83%
|
43
|
|
15
|
19
|
35
|
69%
|
8
|
75%
|
23
|
|
2022
|
25
|
17
|
75%
|
5
|
45%
|
32
|
|
Q1
|
2
|
35
|
32%
|
15
|
52%
|
36
|
|
January
|
16
|
20
|
11%
|
13
|
47%
|
28
|
|
15
|
34
|
28
|
97%
|
20
|
15%
|
17
|
|
25
|
43
|
23
|
66%
|
26
|
47%
|
9
|
|
May
|
20
|
41
|
95%
|
26
|
83%
|
43
|
|
2
|
19
|
35
|
69%
|
8
|
75%
|
23
|
|
2023
|
10
|
15
|
65%
|
4
|
49%
|
29
|
|
Q1
|
2
|
35
|
32%
|
15
|
52%
|
36
|
|
March
|
16
|
20
|
11%
|
13
|
47%
|
28
|
|
10
|
34
|
28
|
97%
|
20
|
15%
|
17
|
|
11
|
43
|
23
|
66%
|
26
|
47%
|
9
|
|
April
|
20
|
41
|
95%
|
26
|
83%
|
43
|
|
15
|
19
|
35
|
69%
|
8
|
75%
|
23
|
Optionally enable sorting by passing sort_menu to any column_definition(s). Sort options are determined by an array of item objects passed to the sort_menu prop.
This example uses a custom sort method that may need to be modified or replaced within your project.
<%# Example sort method for demonstration purposes %> <% if params["sort"] %> <% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %> <% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %> <% @table_data.sort! do |a, b| value_a = a[sort_param] value_b = b[sort_param] value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/) value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/) sort_direction * (value_a <=> value_b) end %> <% end %> <% column_definitions = [ { accessor: "year", label: "Year", cellAccessors: ["quarter", "month", "day"], sort_menu: [ { item: "Year", link: "?sort=year_asc#table-sort", active: params["sort"] == "year_asc", direction: "asc" }, { item: "Year", link: "?sort=year_desc#table-sort", active: params["sort"] == "year_desc", direction: "desc" } ], }, { 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", } ] %> <%= pb_rails("advanced_table", props: { id: "sort", table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %> <%= pb_rails("advanced_table/table_header", props: { table_id: "sort", column_definitions: column_definitions }) %> <%= pb_rails("advanced_table/table_body", props: { table_id: "sort", table_data: @table_data, column_definitions: column_definitions, enable_toggle_expansion: "all" }) %> <% end %>
| Props | Type | Values |
|---|---|---|
gap |
array
|
none
xxs
xs
sm
md
lg
xl
|
max_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
min_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
z_index |
array
|
1
2
3
4
5
6
7
8
9
10
max
|
number_spacing |
array
|
tabular
|
shadow |
array
|
none
deep
deeper
deepest
|
line_height |
array
|
tightest
tighter
tight
normal
loose
looser
loosest
|
display |
array
|
block
inline_block
inline
flex
inline_flex
none
grid
|
cursor |
array
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
crosshair
text
verticalText
alias
copy
move
noDrop
notAllowed
grab
grabbing
eResize
nResize
neResize
nwResize
sResize
seResize
swResize
wResize
ewResize
nsResize
neswResize
nwseResize
colResize
rowResize
allScroll
zoomIn
zoomOut
|
flex_direction |
array
|
row
column
rowReverse
columnReverse
|
flex_wrap |
array
|
wrap
nowrap
wrapReverse
|
justify_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
justify_self |
array
|
auto
start
end
center
stretch
|
align_items |
array
|
flexStart
flexEnd
start
end
center
baseline
stretch
|
align_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_self |
array
|
auto
start
end
center
stretch
baseline
|
flex |
array
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_grow |
array
|
1
0
|
flex_shrink |
array
|
1
0
|
order |
array
|
1
2
3
4
5
6
7
8
9
10
11
12
|
position |
array
|
relative
absolute
fixed
sticky
|
hover |
array
|
|
border_radius |
array
|
none
xs
sm
md
lg
xl
rounded
|
text_align |
array
|
start
end
left
right
center
justify
justify-all
match-parent
|
overflow |
array
|
visible
hidden
scroll
auto
|
truncate |
array
|
1
2
3
4
5
|
left |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
top |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
right |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
bottom |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
vertical_align |
array
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
min_height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
overflow_x |
array
|
visible
hidden
scroll
auto
|
overflow_y |
array
|
visible
hidden
scroll
auto
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
classname |
string
|
|
dark |
boolean
|
|
column_gap |
string
|
|
row_gap |
string
|
|
group_hover |
boolean
|
|
id |
string
|
|
data |
hashprop
|
|
aria |
hashprop
|
|
html_options |
hashprop
|
|
children |
proc
|
|
style |
hashprop
|
| Props | Type | Values | Default |
|---|---|---|---|
max_height |
enum
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
auto
|
table_data |
array
|
||
column_definitions |
array
|
||
column_group_border_color |
enum
|
text_lt_default
text_lt_light
text_lt_lighter
text_dk_default
text_dk_light
text_dk_lighter
none
|
none
|
enable_toggle_expansion |
enum
|
all
header
none
|
header
|
loading |
boolean
|
false
|
|
responsive |
enum
|
none
scroll
|
scroll
|
table_props |
hashprop
|
||
selectable_rows |
boolean
|
false
|
|
show_actions_bar |
boolean
|
true
|
|
actions |
array
|
||
scroll_bar_none |
boolean
|
false
|
|
row_styling |
array
|
||
inline_row_loading |
boolean
|
false
|
|
persist_toggle_expansion_button |
boolean
|
false
|
|
pinned_rows |
hashprop
|