angular / angular/components

[Table] Expose paginated data on MatTableDataSource

Đang mở
#9,419 6 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/table feature P4
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

#### Bug, feature request, or proposal:
feature request

#### What is the expected behavior?
`MatTableDataSource` should provide a method to get currently rendered data which is filtered, sorted and paginated.

#### What is the current behavior?
At the moment I couldn't find the right way to get rendered data(It may exist but it's not documented).

#### What are the steps to reproduce?
--

#### What is the use-case or motivation for changing an existing behavior?
I have found a hacky way to get currently rendered data on the table page.
The data is filtered, sorted, and paginated, so I have to get the currently visible data, for let's say row selection's page toggle(clicking it will select all filtered and sorted data on the current table page).

I'm using `this.dataSource['_renderData']['value']`, but the problem is that, `_renderData` is a `private` property of type `BehaviorSubject`. So accessing data in this way doesn't look good.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
latest

#### Is there anything else we should know?
--

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ MatTableDataSource và kiểm tra cách dữ liệu đã được render, lọc, sắp xếp và phân trang hiện được cung cấp, bao gồm BehaviorSubject riêng tư _renderData được đề cập trong báo cáo. So sánh các API công khai hiện có và xác định một cách được tài liệu hóa để lấy trang hiện tại; hoàn thành nghĩa là người dùng không còn cần truy cập các thuộc tính riêng tư.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.