Skip to content

feature: DataTable2 need scroll event #6228

@zangxx66

Description

@zangxx66

Duplicate Check

Describe the requested feature

Page, View, Column, Row, ListView and GridView introduce scroll_to() method to change their scroll position to either absolute offset, relative delta or jump to the control with specified key.But DataTable2 not includes scroll event and method,I want to achieve infinite scroll but I'm not sure which control's scrolling event I should use.

Suggest a solution

DataTable2 introduce scroll_to() method to achieve infinite scroll

Screenshots

No response

Additional details

import flet as ft

def main(page: ft.Page):
    def on_column_scroll(e: ft.OnScrollEvent):
        print(
            f"Type: {e.event_type}, pixels: {e.pixels}, min_scroll_extent: {e.min_scroll_extent}, max_scroll_extent: {e.max_scroll_extent}"
        )

    cl = ft.Column(
        spacing=10,
        height=200,
        width=200,
        scroll=ft.ScrollMode.ALWAYS,
        on_scroll=on_column_scroll,
    )
    for i in range(0, 50):
        cl.controls.append(ft.Text(f"Text line {i}", key=str(i)))

    page.add(
        ft.Container(cl, border=ft.border.all(1)),
    )

ft.run(main)

Such scroll events like this

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestSuggestion/Request for additional feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions