feyd wrote:Other than being flexible enough to paginate any number of records per page, I can't really think of much else.
That's really the core of it -- limiting results. But there are enough parts (that really should be separate) that it is not that intuitive, so I can understand the questions.
feyd wrote:Maybe a nice to have would be column spanning built in as well.
Can you clarify "column spanning"?
feyd wrote:Possibly groupings (headings) but that's getting more into visual and categorization which for the most part should not be included..
I am guessing that you mean clickable heading that sort on that column. That would be probably be an addition to the basic code that would somewhere trickle down to an "ORDER BY" clause in the SQL. It would be good to separate that part out into the query code, so the code that handles the requests (page number, sort column, etc.) didn't need to know anything about SQL. The other feature beside sorting on columns might be a search feature to reduce the list to less results -- but again that's not for the basic version.
I'll just throw out some random thoughts out:
GENERAL
- OOP hopefully?
- How does it work with other code, such as DB or template libs?
- If HTML is generated how do you handle styles, etc.?
- I notice that some of the classes here generate HTML to make it simpler to use, but that limits customizablity.
- It seems like the solution should be a set of classes but the solutions usually seen here are the easier to use, all-in-one type classes.
QUERY
- Need to be able to add LIMIT clause to SQL
- Is also good do initial query to get COUNT(*) so you can calculate the total number of pages
- What is the query interface? Do we just accept a full SELECT statement. Or do we manage the parts (e.g. fields, tables, where clause) to make it easier to do things like sort order?
- Do we have query object and result set, or just generate SQL and let programmer use their own DB code?
REQUEST PROCESSOR
- Need to determine of a page number is being requested or first time in.
- Calculate related values from page number passed
- Error handling and messages?
- Accept sort order parameters?
- Use Session to keep calculated values or pass/recalculate everything?
PRESENTATION
- Generate full links or just URLs to go to a page number?
- Support next/prev page?
- Support first/last page?
- Generate "Page x of x" type text or just provide access to values?
- What values should be available? Current page, total pages, page start record, page end record, total records?
- Generate links/URLs to control sort order of list?