Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

new DataTable architecture, implementation #63

Closed
wants to merge 47 commits into
from
Commits on Dec 12, 2011
  1. Initial drop of DataTable rearchitecture

    lsmith committed Dec 10, 2011
    Renders a table from supplied columns and data
    as a ModelList with Model instances.  A lot more
    plumbing in place, but not yet exercised.
    
    Progressive enhancement extension in src/pe.js, but
    doesn't have build files yet.
  2. + column.formatter & column.nodeFormatter

    lsmith committed Dec 10, 2011
    Other bug fixes.  Can render from array.
    Column ordering works.  Movin right along.
  3. +getCell and getRow. Grouped, alphabetized methods

    lsmith committed Dec 10, 2011
    Conflicts (resolved)
    
    	src/datatable/js/pe.js
  4. Decouple column parsing, +nested cols

    lsmith committed Dec 12, 2011
    The parsing of column array data was in Core,
    but was parsed into three different forms:
    1) for column access from Core's get('columns.<key>')
    2) for column prep for header rendering
    3) for column prep for body rendering
    
    Now the columns are passed to the views to do with as
    they will, and Core only does what is needed for #1.
    
    Also, parsing nested headers efficiently is a pain in
    the ass.  The 'children' config doesn't allow implementers
    to choose which cells get rowspan when the number of
    header rows is greater than the number of column descendant
    levels.  As is done in 3.4.1, parent cells are always
    rowspan 1.  I prefer to have data related columns have
    rowspan 1, but the logic to support that with the "children"
    config would be crazy complex.  Implementers can move stuff
    around in `table.head.columns` before `render()` if they want
    different cell placement and spanning.
  5. Simplify stack processing.

    lsmith committed Dec 12, 2011
    Instead of managing two stacks, one for the
    row and one for the column index, just use one
    stack and have each entry store the row and index.
  6. Fix wrong `this` in column parser

    lsmith committed Dec 12, 2011
    Conflicts (resolved):
    
    	src/datatable/js/pe.js
Commits on Dec 14, 2011
  1. A medley of updates (see details below)

    lsmith committed Dec 14, 2011
      * remove support for generic attribute population
        from `formatters` (use `nodeFormatter`s)
      * remove columnChange implementation in favor of a full
        redraw (for now)
      * add `getCell` and `getRow`
      * add `getClassName` and `cssPrefix` config that allows
        `getClassName` to generate classes like the view's host.
      * use `container` and `modelList` attributes (I got mixed up
        with 3.4.1 Views having those as properties.
      * add column index to the displayed column objects.
  2. Add `getCell` and `getRow` pass thrus

    lsmith committed Dec 14, 2011
    Also pass the `_cssPrefix` to the views for use by
    their `getClassName` implementations, and instantiate
    the view classes with `container` and `modelList`
Commits on Dec 16, 2011
  1. Add API docs and minor fixes as I see them

    lsmith committed Dec 16, 2011
    Ongoing.
Commits on Dec 20, 2011
  1. Add API docs, split out render per row

    lsmith committed Dec 20, 2011
    I'll need the logic that applied a Model to the
    _rowTemplate in the _afterDataChange handler,
    so I moved it into a separate method.
    
    Added API docs, though the description is still
    incomplete.
  2. Finish API docs for current API

    lsmith committed Dec 20, 2011
    There will be more.  Oh, so much more.
Commits on Dec 21, 2011
  1. s/validator/setter/ for recordType

    lsmith committed Dec 21, 2011
    The setter method was already in place, I just
    forgot to update the ATTRS.recordType config.
Commits on Dec 22, 2011
  1. Split out view config properties

    lsmith committed Dec 22, 2011
    Class extensions can add to the config object passed
    to the constructor of the appropriate view when the
    render() process instantiates the view.
  2. Move `renderUI` to @protected section

    lsmith committed Dec 22, 2011
Commits on Dec 23, 2011
  1. Add baseline support for row add/change/remove

    lsmith committed Dec 23, 2011
    The starting point will be to rerender the entire table.
    The next step is to create a plugin that handles the
    changes intelligently.
  2. +HTML escaping, dup column handling, col mutation

    lsmith committed Dec 23, 2011
    Added HTML escaping of all cell data in the generated
    markup string, and column config property `allowHTML` to
    bypass it in the case that HTML is expected.
    
    Fixed an issue where if multiple columns referred to the
    same key and at elast one had a formatter, that formatter
    would affect the rendered content of all like key columns.
    
    Added baseline logic to rerender the tbody if the columns
    are changed.  Optimized mutation handling can be relegated
    to a plugin.
  3. Clean up PE plumbing, +column mutation

    lsmith committed Dec 23, 2011
    Baseline handling of columns change is to
    rerender the thead.  Optimized handling can be
    relegated to a plugin.
    
    If render() finds an existing, appropriately
    classed thead, it will skip rendering and use
    that one.
  4. Loosen search for existing thead

    lsmith committed Dec 23, 2011
    It was looking for an existing thead with the DT
    class on it, but ANY thead would need to be
    replaced.  Options were:
    
    1. Accept only an appropriately classed thead and
       replace any other thead, or
    2. Accept any thead and use it rather than creating
       a new one.
    
    I chose the latter, but may change my mind later.
Commits on Jan 5, 2012
Commits on Jan 6, 2012
  1. Fix regression with empty cell {token}s

    lsmith committed Jan 6, 2012
    The emptyCellValue check wasn't setting '' for
    empty cells without a configured emptyCellValue,
    so the {token} was left in the markup.  Also, the
    addition of allowHTML replaced unpopulated tokens
    with 'undefined'.
  2. +API docs, -reset() method

    lsmith committed Jan 6, 2012
    `table.reset(blah)` was removed in favor of
    `table.set('data', blah);`
Commits on Jan 10, 2012
  1. Move tbody,foot,head creation into Core

    lsmith committed Jan 10, 2012
    It simplifies logic to have the Views working
    with the table sections rather than the table
    itself.
    
    Unrelated, renamed _uiUpdateWidth to _uiSetWidth
    to override the Widget method that just set
    dims on the boundingBox.
Commits on Jan 11, 2012
  1. Merge branch 'master' into dtxpr

    lsmith committed Jan 11, 2012
  2. Merge branch 'master' into dtxpr

    lsmith committed Jan 11, 2012
Commits on Jan 12, 2012
  1. Add colgroup,col rendering and col width support

    lsmith committed Jan 12, 2012
    Column widths are assigned via CSS on the <col>
    node associated with a given column, which is
    effectively a min-width.  If content in the column
    cells will not fit in the configured width, it will
    expand the column.  This is unfortunate native DOM
    behavior.
    
    I will create a separate module that enforces column
    width-based truncation, but that's not core
    functionality.
Commits on Jan 13, 2012
  1. _uiSetCols takes boolean to force col replacement

    lsmith committed Jan 13, 2012
    Also, minor bug fix - remove subscription to widthChange.
    _afterWidthChange wasn't defined, resulting in the object
    syntax subscription to after() to cause widthChanges to
    be handled by _afterSummaryChange.  Oops!  Widget already
    wired up the widthChange sub, so no need to subscribe.
  2. Add position:relative to the scroll container

    lsmith committed Jan 13, 2012
    for offsetTop needed in height calculation.
  3. Merge branch 'master' into dtxpr

    lsmith committed Jan 13, 2012
  4. Verify that Y.DataTable is a function

    lsmith committed Jan 13, 2012
    Per the requires, datatable-base should run
    before mutable, but it's failing in my loaderless
    dev env, so I may as well be safe about it.
  5. Refactor the rendering mechanism to use events

    lsmith committed Jan 13, 2012
    The view instances were inaccessible prior to
    render().  So I moved the renderUI logic into a
    renderTable event defaultFn. That defaultFn then
    sets up the table, caption, and columns, then fires
    renderHeader, renderFooter, and renderBody events.
    
    Each of these events call the view's render() method
    and finish up.  Flexibility achieved!
Commits on Jan 17, 2012
  1. -column widths (extension). +data bubbles to table

    lsmith committed Jan 17, 2012
    Extracted the column width assignment code to the
    datatable-column-widths module.
    
    Made the ModelList bubble events to the DataTable
    instance.
Commits on Jan 18, 2012