⌂
›
Extensions
›
DataTable2
DataTable2 extension
Render a table with fixed rows or columns and richer scrolling and sizing options.
Enable the extension
Add the extension key to ruflet.yaml:
extensions:
- datatable2
Run ruflet run during development or ruflet build <target> for a release. Extension packages are compiled into the Ruflet client, so rebuild the client after changing this list.
Ruby DSL example
table = control(
"DataTable2",
fixed_top_rows: 1,
columns: [data_column(label: text(value: "Name"))],
rows: [data_row(cells: [data_cell(content: text(value: "Ruflet"))])],
on_select_all: ->(event) { puts event.value }
)
page.add(table)
API provided
- Extension key:
datatable2 - Flet package:
flet_datatable2 - Kind: Data control
- DataColumn control reference — complete helpers, properties, events, and methods.
- DataRow control reference — complete helpers, properties, events, and methods.
- DataCell control reference — complete helpers, properties, events, and methods.
- Wire controls:
DataTable2
Properties
bgcolor— Background color.border— Border definition.border_radius— Corner radius.bottom_margin— Sets the bottom margin property.checkbox_alignment— Checkbox alignment.checkbox_horizontal_margin— Sets the checkbox horizontal margin property.clip_behavior— How content overflowing the bounds is clipped.column_spacing— Sets the column spacing property.columns— Sets the columns property.data_row_height— Data row height.data_text_style— Data text style.divider_thickness— Sets the divider thickness property.empty— Sets the empty property.fixed_columns_color— Fixed columns color.fixed_corner_color— Fixed corner color.fixed_left_columns— Sets the fixed left columns property.fixed_top_rows— Sets the fixed top rows property.gradient— Sets the gradient property.heading_row_decoration— Sets the heading row decoration property.heading_row_height— Heading row height.heading_text_style— Heading text style.horizontal_lines— Sets the horizontal lines property.horizontal_margin— Sets the horizontal margin property.lm_ratio— Sets the lm ratio property.min_width— Min width.rows— Sets the rows property.show_bottom_border— Sets the show bottom border property.show_checkbox_column— Sets the show checkbox column property.show_heading_checkbox— Sets the show heading checkbox property.sm_ratio— Sets the sm ratio property.sort_arrow_animation_duration— Sets the sort arrow animation duration property.sort_arrow_icon— Sort arrow icon.sort_arrow_icon_color— Sort arrow icon color.sort_ascending— Sets the sort ascending property.sort_column_index— Sets the sort column index property.vertical_lines— Sets the vertical lines property.visible_horizontal_scroll_bar— Sets the visible horizontal scroll bar property.visible_vertical_scroll_bar— Sets the visible vertical scroll bar property.
Events
on_double_tap— Fired on a double tap.on_long_press— Fired on a long press.on_secondary_tap— Fired on secondary tap.on_secondary_tap_down— Fired on secondary tap down.on_select_all— Fired on select all.on_select_change— Fired on select change.on_sort— Fired on sort.on_tap— Fired on a tap.on_tap_cancel— Fired when a tap is cancelled.on_tap_down— Fired when a pointer presses down.
Permissions and platforms
No protected service declaration is added automatically. Platform support still follows the underlying Flet extension, so test every target you ship.
Build behavior
Ruflet resolves the extension key to flet_datatable2 and includes that Flet package through the client extension pipeline. Application code uses the Ruby DSL shown above; do not add the package directly to your app's Flutter dependencies.