[Grid]: Multiple selection and paging not work togehter

Đang mở
#1,142 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Start by locating the Grid component’s client-side DataProvider, paging, and multiple-selection handling; the issue names no source files or tests. Reproduce by selecting items, changing pages, and checking whether selection remains visible and SelectedItemsChanged fires as expected. Done when selections persist across page changes in the described setup.

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

Mô tả

I have a Grid with AllowPaging, AllowSelection, and SelectionMode="GridSelectionMode.Multiple". I configured a DataProvider for client-side mode.

Selection and paging work, but when I select some items and then change the page, the selection is cleared. I tried storing SelectedItems in a local variable, but that didn't help.

I also noticed that every time I change the page, the SelectedItemsChanged function is called. So, in that function I added something like:

if (items is not null && items.Count > 0)
{
    foreach (var item in items)
    {
        if (!SelectedItems.Any(s => s.Id == item.Id))
        {
            SelectedItems.Add(item);
        }
    }
}

to keep the selected items, but if I change page in a one with items selected, in the Grid those are non seletect.

I try also

private async Task<GridDataProviderResult<MyItem>> TableItemsResultDataProvider(GridDataProviderRequest<MyItem> request)
{
    var result = await Task.FromResult(request.ApplyTo(TableItems));
    itemsGrid.SelectedItems = SelectedItems;
    return result;
}

But items alread not selected.

Ngôn ngữ chính
HTML
Star
1.2k
Fork
111
Merge trung bình
4 phút
Pull request đã merge (30 ngày)
55

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vikramlearning/blazorbootstrap

Tất cả issue của vikramlearning/blazorbootstrap

Issue tương tự

Thêm issue về Web Dev

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.