Census PageForm.js
James Cobban edited this page Nov 28, 2019
·
1 revision
This script implements the dynamic functionality of the script
PageForm.php
which displays the instances of class Page describing every page of an
enumeration division, that is an instance of class SubDistrict. T
One of the features of this script is that the body portion of the table is scrolled if there are too many pages in the enumeration division to be displayed all at once, while keeping the column headers displayed and aligned with the data columns. This turns out to be not entirely intuitive.
- CSS supports scrolling any element which has style
"display:block"
, but the default style for each of the sections of a table is"table-row-group"
, so it is necessary to explicitly set the style for<thead>
,<tbody>
, and<tfoot>
to"display:block"
before the"overflow-y"
style is honored. - Changing the display style for the
<thead>
loses the automatic support for ensuring that the width of each<th>
is the same as the width of the associated<td>
cells in the body. It is therefore necessary to use Javascript to explicitly set the width of each<th>
to match the width of the data column.
This script also supports the use of the common event handler columnClick to hide and redisplay columns by clicking on the column header.
Next: PageForm.php