Purpose
- Some Inquiry pages in FrontAccounting can be quite long
- Splitting across multiple pages is available
- The number of lines displayed on each page is globally set
- A lot of lines on each page makes for fewer page clicks
- Long pages need to be scrolled when it exceeds device display height
- The top header lines will move off the top of the display when scrolling down
- To still be able to see the headers we can inject them into the table every say 10 lines.
- Forum Post
How Paging Works
- The
function display_db_pager()
defined in includes/ui/db_pager_view.inc
is responsible for almost all tabular paged displays in FA.
- All Inquiries in FA use the files in the
XXX/inquiry/
folder.
- Changes to the core function
display_db_pager()
will affect all tabular displays in FrontAccounting.
- Clone the said function and then call it in the desired inquiry files to affect only those pages.
Code Modifications
- The code in the
function display_db_pager()
that displays the headings is:
table_header($headers);
- Choose a line in the record iteration loop say line 85 in
includes/ui/db_pager_view.inc
and insert it to be:
if ($line_no > 1 && $line_no % 10 === 0) table_header($headers);
- If only specific inquiry pages are to be so shown, edit them replacing their call to
function display_db_pager()
with the cloned function name and make sure the modified line above is only in the cloned function so as not to affect all else.