I have a data model that looks like this:
Group 1
--Sub group1
----item1
----item2
----item3
--Sub group2
----item1
----item2
----item3
Group 2
--Sub group1
----item1
----item2
----item3
--Sub group2
----item1
----item2
----item3
There will be n number of each group and I would like to display this data on screen.
A requirement is to use paging but I am a little unsure of how to effectively page when there are these groupings involved. Ordinarily I would just retrieve the next n records and append to the existing set but will need something a little more complicated.
Does anyone have any experience doing something like this? I don't want to grab entire sub groups at a time as they may contain too many or too few items, and would like to be consistent by pulling the same number of items each time.
page sizeis10items butGroup 1has a total of5sub-items andGroup 2has a total of7? DoesGroup 2get included in the page? Does it get omitted? Or does it get truncated only to be resumed on the next page? These are important UX questions so I think you should start from a UX point of view first. That will help better define the problem you are trying to solve.