Class extension (auto-mix()ed with default disabling scrolling?) or subclass? If subclass, subclass of Y.DataTable.Base or Y.DataTable? Or new class Base.create()ed from Y.DataTable.Core?
Should add additional/override logic for the height and width attributes to expand the table to those dimensions. Optionally, add an attribute scrollable with available values:
'vertical' or 'y' - vertical scrolling only if height is set. If width is set, ignore for scrolling.
'horizontal' or 'x' - likewise
true, 'all', 'both', or 'xy' - if height is set, triggers vertical scrollability; if width, horizontal. Both == both.
false - behaves like a non-scrollable DT (default?)
I want a smarter scrolling DT that renders a single table if the data rows don't go beyond the configured height/width and can swap the single table with a split table implementation while preserving the <thead> and <tbody> in response to data changes or height/width changes.
Column width syncing should be done much like it is today, but don't use stylesheets unless necessary.
Remove the width styles from the header table, body table, all columns in the header, and the first row of data cells.
Apply fixed widths to both header cell and body table cell (see caveats) for columns configured with widths
Iterate the remaining columns, applying the greater of the two widths to both header and body cells.
Caveats:
height/width should support percentages. If percentages are detected, a resize subscription should be applied to keep things synced.
If a caption is configured/present, should the table height correspond to the configured height or to height - (calculated caption height)?
If a configured cell width is narrower than the content width (applied to liner div to allow truncation), the td width will differ from the liner width by greater than the width of padding + border and will need to result in all cells in that column having the smaller width applied. This will impact performance, so only do this for columns that fall into this scenario. However, such a column would need all cells' widths removed before calculating col widths for the next sync. Can this be done off-DOM, leaving a temporary cloneNode() in its place while the operations were performed?
Class extension (auto-mix()ed with default disabling scrolling?) or subclass? If subclass, subclass of
Y.DataTable.Base
orY.DataTable
? Or new classBase.create()
ed fromY.DataTable.Core
?Should add additional/override logic for the
height
andwidth
attributes to expand the table to those dimensions. Optionally, add an attributescrollable
with available values:height
is set. Ifwidth
is set, ignore for scrolling.true
, 'all', 'both', or 'xy' - ifheight
is set, triggers vertical scrollability; ifwidth
, horizontal. Both == both.false
- behaves like a non-scrollable DT (default?)I want a smarter scrolling DT that renders a single table if the data rows don't go beyond the configured height/width and can swap the single table with a split table implementation while preserving the
<thead>
and<tbody>
in response todata
changes or height/width changes.Column width syncing should be done much like it is today, but don't use stylesheets unless necessary.
Caveats:
height
or toheight
- (calculated caption height)?cloneNode()
in its place while the operations were performed?