apache / apache/grails-core

Feature Request - Total Count of Data in Pagination

Open
#14,310 2 comments 0 reactions 0 assignees View on GitHub
relates-to: grails-views
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

I'm working with Grails JSON Views and discovered that it's not configurable in a few ways.

1. Count of the total rows of data cannot be enabled in jsonapi.render(). If I don't know the total count of the data, how can I construct my pagination view in pure html format such as this:

screen shot 2017-12-12 at 2 23 52 pm

I can make another API call to specifically know the count of my rows of data. But if this can be enabled and be shown in the json output would be better.

```
{
data: [],
links: {},
total: '40'
}

```

Contributor guide

Open the contributing guide

Research direction

Start with the jsonapi.render() pagination response and trace where its data and links fields are assembled. Confirm how pagination metadata is currently exposed, then define completion as returning a total field containing the total row count alongside the existing JSON output.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.