|
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
|
The optional loading prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
<% column_definitions = [ { 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", } ] %> <%= pb_rails("advanced_table", props: { id: "loading_table", table_data: @table_data, column_definitions: column_definitions, loading: true }) %>
|
Year
|
New Enrollments
|
Scheduled Meetings
|
Attendance Rate
|
Completed Classes
|
Class Completion Rate
|
Graduated Students
|
|---|---|---|---|---|---|---|
|
2021
|
20
|
10
|
51%
|
3
|
33%
|
19
|
Loading
| ||||||
|
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
|
|
Year
|
New Enrollments
|
Scheduled Meetings
|
Attendance Rate
|
Completed Classes
|
Class Completion Rate
|
Graduated Students
|
|---|---|---|---|---|---|---|
|
2021
|
20
|
10
|
51%
|
3
|
33%
|
19
|
Loading
| ||||||
|
2022
|
25
|
17
|
75%
|
5
|
45%
|
32
|
Loading
| ||||||
|
2023
|
10
|
15
|
65%
|
4
|
49%
|
29
|
Loading
| ||||||
|
Year
|
New Enrollments
|
Scheduled Meetings
|
Attendance Rate
|
Completed Classes
|
Class Completion Rate
|
Graduated Students
|
|---|---|---|---|---|---|---|
|
2021
|
20
|
10
|
51%
|
3
|
33%
|
19
|
Loading
| ||||||
|
2022
|
25
|
17
|
75%
|
5
|
45%
|
32
|
Loading
| ||||||
|
2023
|
10
|
15
|
65%
|
4
|
49%
|
29
|
Loading
| ||||||
By default, the kit assumes that the initial dataset is complete, rendering expansion controls only when children are present. If, however, you want to implement lazy-loading patterns where children are fetched only when a parent is expanded, use the inline_row_loading prop.
When inline_row_loading is set to true:
children arrays (you must pass children: [] to any row that will have children loaded later)In the first table above, row "2021" has an empty children array. Click to expand it and see the inline loading state. Rows 2 and 3 have actual child data.
This prop is set to false by default.
The persist_toggle_expansion_button is a boolean prop that renders the toggle-all icon in the top left header cell for complex datasets with empty children arrays and advanced querying logic explained in the preceding doc example. Your logic may require an additional query helper file to update data specifically from requerying via toggle all buttons.
In the second and third Advanced Tables in this code example, all 3 rows have empty children arrays. The second Advanced Table demonstrates that the toggle all button does not render (prior to an initial row expansion) without persist_toggle_expansion_button in place. The third Advanced Table shows the toggle all button due to persist_toggle_expansion_button.
This prop is set to false by default and should only be used in conjunction with inline_row_loading.
<% column_definitions = [ { 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", } ] %> <%= pb_rails("caption", props: { text: "Inline Row Loading - Demonstrated in Row 1 (Rows 2 and 3 have data)" }) %> <%= pb_rails("advanced_table", props: { id: "inline-loading-table-1", table_data: @table_data_inline_loading, column_definitions: column_definitions, enable_toggle_expansion: "all", inline_row_loading: true, margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "Inline Row Loading with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is not rendered" }) %> <%= pb_rails("advanced_table", props: { id: "inline-loading-table-2", table_data: @table_data_inline_loading_empty_children, column_definitions: column_definitions, enable_toggle_expansion: "all", inline_row_loading: true, margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "Inline Row Loading and Persist Toggle Expansion Button with No Subrow Data - All Rows Display Inline Row Loading and the Toggle All Button is rendered" }) %> <%= pb_rails("advanced_table", props: { id: "inline-loading-table-3", table_data: @table_data_inline_loading_empty_children, column_definitions: column_definitions, enable_toggle_expansion: "all", inline_row_loading: true, persist_toggle_expansion_button: true }) %>
| Props | Type | Values |
|---|---|---|
align_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_items |
enum | responsive
|
start
end
center
|
border_radius |
enum
|
none
xs
sm
md
lg
xl
rounded
|
cursor |
enum
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
|
dark |
boolean
|
true
false
|
flex |
enum | responsive
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_direction |
enum | responsive
|
row
column
rowReverse
columnReverse
|
flex_wrap |
enum | responsive
|
wrap
nowrap
wrapReverse
|
justify_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
line_height |
enum
|
loosest
looser
loose
normal
tight
tighter
tightest
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
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
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
width |
string
|
|
min_width |
string
|
|
max_width |
string
|
|
gap |
string | responsive
|
|
column_gap |
string | responsive
|
|
row_gap |
string | responsive
|
|
number_spacing |
enum
|
tabular
|
order |
enum | responsive
|
none
first
1
2
3
4
5
6
7
8
9
10
11
12
|
overflow_x |
enum
|
scroll
visible
hidden
auto
|
overflow_y |
enum
|
scroll
visible
hidden
auto
|
overflow |
enum
|
scroll
visible
hidden
auto
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
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
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
position |
enum
|
relative
absolute
fixed
sticky
static
|
shadow |
enum
|
none
deep
deeper
deepest
|
text_align |
enum | responsive
|
start
end
left
right
center
justify
justifyAll
matchParent
|
truncate |
enum
|
none
1
2
3
4
5
|
vertical_align |
enum | responsive
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
z_index |
enum | responsive
|
1
2
3
4
5
6
7
8
9
10
max
|
top |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
inset |
boolean
|
true
false
|
right |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
bottom |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
left |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
height |
string
|
|
max_height |
string
|
|
min_height |
string
|
|
hover |
object
|
|
group_hover |
boolean
|
true
false
|
| Props | Type | Values | Default |
|---|---|---|---|
actions |
react.reactnode[] | react.reactnode
|
||
cascade_collapse |
boolean
|
true
false
|
|
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
|
column_visibility_control |
genericobject
|
||
custom_sort |
boolean
|
true
false
|
|
enable_toggle_expansion |
enum
|
all
header
none
|
header
|
enable_sorting_removal |
boolean
|
true
false
|
|
expanded_control |
genericobject
|
||
expand_by_depth |
{ [key: string]: string | number }
|
||
on_expand_by_depth_click |
function
|
||
initial_loading_rows_count |
number
|
||
inline_row_loading |
boolean
|
true
false
|
false
|
loading |
boolean | string
|
false
|
|
on_row_toggle_click |
function
|
||
on_toggle_expansion_click |
function
|
||
pagination |
boolean
|
true
false
|
|
pagination_props |
function
|
||
responsive |
enum
|
scroll
none
|
scroll
|
row_styling |
array
|
||
scroll_bar_none |
boolean
|
true
false
|
false
|
selectable_rows |
boolean
|
true
false
|
false
|
show_actions_bar |
boolean
|
true
false
|
true
|
persist_toggle_expansion_button |
boolean
|
true
false
|
false
|
sort_control |
genericobject
|
||
sort_parent_only |
boolean
|
true
false
|
|
table_data |
array
|
||
table_options |
genericobject
|
||
table_props |
genericobject
|
||
toggle_expansion_icon |
string | string[]
|
||
on_row_selection_change |
function
|
||
on_custom_sort_click |
function
|
||
virtualized_rows |
boolean
|
true
false
|
|
allow_full_screen |
boolean
|
true
false
|
|
full_screen_control |
function
|
||
pinned_rows |
string
|