Metro-UI-CSS icon indicating copy to clipboard operation
Metro-UI-CSS copied to clipboard

Server side pagination support?

Open smx-smx opened this issue 1 year ago • 0 comments

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

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

smx-smx avatar Jul 07 '22 14:07 smx-smx