7d541270fcdc9b0042961059f726bc340438b7e7Eric FerraiuoloProvides a Widget that is responsible for rendering columnar data into a highly
7d541270fcdc9b0042961059f726bc340438b7e7Eric Ferraiuolocustomizable and fully accessible HTML table. The core functionality of
7d541270fcdc9b0042961059f726bc340438b7e7Eric FerraiuoloDataTable is to visualize structured data as a table. A variety of Plugins can
7d541270fcdc9b0042961059f726bc340438b7e7Eric Ferraiuolothen be used to add features to the table such as sorting and scrolling.
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithAs of 3.5.0, the architecture and APIs have changed to the following architecture:
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithClass composition
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith---------------------------
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Class extension
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * APIs and ATTRS for extending Widget
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Responsible for rendering the `<table>`, `<caption>`, and empty `<thead>`, `<tfoot>`, and `<tbody>` as appropriate
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Widget generated from `Y.Base.create('datatable', Y.Widget, [Core])`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Featureless DataTable constructor
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Defaults `headerView` to `Y.DataTable.HeaderView` and `bodyView` to `Y.DataTable.BodyView`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Constructor with all `use()`d features
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Namespace for DT-specific extensions and component classes
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * `Y.View` subclass
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Renders the content of the `<thead>`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * `Y.View` subclass
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Renders the content of the `<tbody>`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Class extension
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Renders `<colgroup>` and `<col>`s
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Supports `width` configuration in column defs
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Adds `setColumnWidth()` method
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Automatically mixed onto `Y.DataTable`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Class extension
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Adds `addRow()`, `addRows()`, `addColumn()`, `modifyColumn()`, etc
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith * Automatically mixed onto `Y.DataTable`
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithIs a bubble target for it's ModelList and all configured View instances, so inherits all their events. Events fired directly from DataTable:
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `renderTable` - fired from `renderUI`, default function creates the `<table>` and `<caption>` and fires the other render events
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `renderHead` - fired from `renderTable`'s default function IFF `headerView` is set. Default action calls `render` on the View
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `renderFoot` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `renderBody` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `addColumn` - From `Y.DataTable.Mutable` extension, fired from the so-named method
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `removeColumn` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `modifyColumn` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `moveColumn` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith---------------
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `data` - the ModelList instance
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `head` - the `headerView` instance, populated by `renderHead`'s default function
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `body` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `foot` - (same)
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_tableNode` - Node instance of the `<table>` element
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_captionNode` - likewise for `<caption>`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_colgroupNode` - and for `<colgroup>`, from `Y.DataTable.ColumnWidths`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_theadNode` - you guessed it
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_tbodyNode` - yep, but only one. This might come back to haunt me
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_tfootNode` - predictably
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_viewConfig` - base config object (aka prototype) for...
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_headerConfig` - specific configuration values to pass to the `headerView` constructor
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_bodyConfig` - specific configuration values to pass to the `bodyView` constructor
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith* `_footerConfig` - specific configuration values to pass to the `footerView` constructor
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithRender lifecycle
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith-----------------------
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithThis is the base rendering; augmented rendering for column widths left out.
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith1. `renderUI` fires `renderTable`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith2. `renderTable`'s `defaultFn` creates the `<table>`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith3. if `headerView` is set
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith 1. creates a `<thead>`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith 2. creates an instance of the `headerClass`, passing the `_headerConfig` object plus the `<thead>` as a "container", and `data` as the "modelList"
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith 3. fires the `renderHead` event, passing the View instance as payload
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith 4. `renderHead`'s `defaultFn` calls the View's `render()` method
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith4. repeat for `footerView`, then `bodyView`
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith5. `bindUI` does the usual thing
8ee89d3e45803644270e1aea29f921a36c45b978Luke Smith6. `syncUI` creates the `<caption>` if the attribute is set, and so for the `<table>`'s `summary` attribute
8ee89d3e45803644270e1aea29f921a36c45b978Luke SmithSee the user guide (http://yuilibrary.com/datatable/) for more information.