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

Server side pagination support? #1876

Open
smx-smx opened this issue Jul 7, 2022 · 0 comments
Open

Server side pagination support? #1876

smx-smx opened this issue Jul 7, 2022 · 0 comments

Comments

@smx-smx
Copy link

smx-smx commented Jul 7, 2022

Hello.
I just realised in a new project that datatables is no longer supported, as i can see from README and the following commit: 546e6af

What i was using Datatables for is the server side pagination feature, like this:

ajax: async function(data:any, callback:CallableFunction, settings:any){
                // fetch
                let result = await api.getUsers({
                    start: data.start + 1,
                    limit: data.length,
                    order: data.order
                });

                // render
                callback({
                    draw: data.draw,
                    data: result.users,
                    recordsTotal: result.total,
                    recordsFiltered: result.total
                });
            }

start, limit and order are passed by Datatables (as documented here: https://datatables.net/manual/server-side), and are then used to construct a SELECT .. ORDER .. LIMIT query on the server.

Is it possible to achieve the same with Metro4's data-source option? the goal is to fetch only the data for the current page rather than fetching everything in advance

Thanks in advance

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

No branches or pull requests

1 participant