Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging with Detail View #718

Closed
jxs0900 opened this issue Dec 28, 2022 · 4 comments
Closed

Paging with Detail View #718

jxs0900 opened this issue Dec 28, 2022 · 4 comments
Labels

Comments

@jxs0900
Copy link

jxs0900 commented Dec 28, 2022

Paging while any row details are expanded doesn't work. How should paging and row details be configured to work together?

@jxs0900
Copy link
Author

jxs0900 commented Dec 28, 2022

In slick.pager.js I added detailView.collapseAll(); to the first line inside the gotoFirst() gotoLast() gotoPrev() and gotoNext() methods.

`

   function gotoFirst()
    {
        detailView.collapseAll();
        if (getNavState().canGotoFirst)
        {
            dataView.setPagingOptions({ pageNum: 0 });
        }
    }

    function gotoLast()
    {
        detailView.collapseAll();
        var state = getNavState();
        if (state.canGotoLast)
        {
            dataView.setPagingOptions({ pageNum: state.pagingInfo.totalPages - 1 });
        }
    } 

    function gotoPrev()
    {
        detailView.collapseAll();
        var state = getNavState();
        if (state.canGotoPrev)
        {
            dataView.setPagingOptions({ pageNum: state.pagingInfo.pageNum - 1 });
        }
    }

    function gotoNext()
    {
        detailView.collapseAll();
        var state = getNavState();
        if (state.canGotoNext)
        {
            dataView.setPagingOptions({ pageNum: state.pagingInfo.pageNum + 1 });
        }
    }`

@ghiscoding
Copy link
Collaborator

it's not surprising, Row Detail was not created to be used with Pagination. The way the plugin works is that it takes x amount of rows to show the row detail, the default is probably around 5 rows or something similar, this mean that it will require the 5 extra rows to be displayed so that it can take its space, but if the rows aren't there then... It might work when there's enough rows to display the row detail but what will happen when the row detail is at the bottom of the grid!? The other problem is that when it displays the row detail, it pushes everything down by x amount of rows (around 5 like I said earlier), but it does this in the current grid and page, the next page will probably not know that its data got pushed by x amount of rows.

If you have ways to fix this, PRs are totally welcome

@jxs0900
Copy link
Author

jxs0900 commented Dec 29, 2022

It is behaving exactly like you said. It works good enough with the change I made to get me by for now. I'm thinking I may remove the detailview plugin and just show details in a modal div.

@ghiscoding
Copy link
Collaborator

closing since we will probably never support Row Detail with Pagination because of the extra complexity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants