var __cov_rX2UuRixIqrM1QstWIi4lQ = (Function('return this'))(); if (!__cov_rX2UuRixIqrM1QstWIi4lQ.__coverage__) { __cov_rX2UuRixIqrM1QstWIi4lQ.__coverage__ = {}; } __cov_rX2UuRixIqrM1QstWIi4lQ = __cov_rX2UuRixIqrM1QstWIi4lQ.__coverage__; if (!(__cov_rX2UuRixIqrM1QstWIi4lQ['build/datatable-base/datatable-base.js'])) { __cov_rX2UuRixIqrM1QstWIi4lQ['build/datatable-base/datatable-base.js'] = {"path":"build/datatable-base/datatable-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":1,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0},"b":{"1":[0,0],"2":[0,0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":236,"loc":{"start":{"line":236,"column":14},"end":{"line":236,"column":26}}},"3":{"name":"(anonymous_3)","line":249,"loc":{"start":{"line":249,"column":16},"end":{"line":249,"column":28}}},"4":{"name":"(anonymous_4)","line":284,"loc":{"start":{"line":284,"column":13},"end":{"line":284,"column":42}}},"5":{"name":"(anonymous_5)","line":302,"loc":{"start":{"line":302,"column":12},"end":{"line":302,"column":32}}},"6":{"name":"(anonymous_6)","line":317,"loc":{"start":{"line":317,"column":32},"end":{"line":317,"column":45}}},"7":{"name":"(anonymous_7)","line":328,"loc":{"start":{"line":328,"column":12},"end":{"line":328,"column":24}}},"8":{"name":"(anonymous_8)","line":346,"loc":{"start":{"line":346,"column":22},"end":{"line":346,"column":35}}},"9":{"name":"(anonymous_9)","line":360,"loc":{"start":{"line":360,"column":28},"end":{"line":360,"column":47}}},"10":{"name":"process","line":363,"loc":{"start":{"line":363,"column":8},"end":{"line":363,"column":31}}},"11":{"name":"(anonymous_11)","line":398,"loc":{"start":{"line":398,"column":17},"end":{"line":398,"column":29}}},"12":{"name":"(anonymous_12)","line":421,"loc":{"start":{"line":421,"column":26},"end":{"line":421,"column":39}}},"13":{"name":"(anonymous_13)","line":435,"loc":{"start":{"line":435,"column":14},"end":{"line":435,"column":26}}},"14":{"name":"(anonymous_14)","line":455,"loc":{"start":{"line":455,"column":34},"end":{"line":455,"column":47}}},"15":{"name":"(anonymous_15)","line":463,"loc":{"start":{"line":463,"column":34},"end":{"line":463,"column":47}}},"16":{"name":"(anonymous_16)","line":468,"loc":{"start":{"line":468,"column":32},"end":{"line":468,"column":45}}},"17":{"name":"(anonymous_17)","line":475,"loc":{"start":{"line":475,"column":33},"end":{"line":475,"column":45}}},"18":{"name":"(anonymous_18)","line":520,"loc":{"start":{"line":520,"column":12},"end":{"line":520,"column":24}}},"19":{"name":"(anonymous_19)","line":534,"loc":{"start":{"line":534,"column":19},"end":{"line":534,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":694,"column":3}},"2":{"start":{"line":219,"column":0},"end":{"line":676,"column":3}},"3":{"start":{"line":237,"column":8},"end":{"line":237,"column":48}},"4":{"start":{"line":239,"column":8},"end":{"line":239,"column":64}},"5":{"start":{"line":250,"column":8},"end":{"line":252,"column":9}},"6":{"start":{"line":251,"column":12},"end":{"line":251,"column":32}},"7":{"start":{"line":285,"column":8},"end":{"line":286,"column":58}},"8":{"start":{"line":303,"column":8},"end":{"line":304,"column":57}},"9":{"start":{"line":318,"column":8},"end":{"line":318,"column":52}},"10":{"start":{"line":329,"column":8},"end":{"line":335,"column":50}},"11":{"start":{"line":347,"column":8},"end":{"line":347,"column":24}},"12":{"start":{"line":361,"column":8},"end":{"line":361,"column":32}},"13":{"start":{"line":363,"column":8},"end":{"line":375,"column":9}},"14":{"start":{"line":364,"column":12},"end":{"line":364,"column":28}},"15":{"start":{"line":366,"column":12},"end":{"line":374,"column":13}},"16":{"start":{"line":367,"column":16},"end":{"line":367,"column":30}},"17":{"start":{"line":369,"column":16},"end":{"line":373,"column":17}},"18":{"start":{"line":370,"column":20},"end":{"line":370,"column":42}},"19":{"start":{"line":372,"column":20},"end":{"line":372,"column":45}},"20":{"start":{"line":377,"column":8},"end":{"line":377,"column":25}},"21":{"start":{"line":387,"column":8},"end":{"line":387,"column":46}},"22":{"start":{"line":399,"column":8},"end":{"line":401,"column":11}},"23":{"start":{"line":405,"column":8},"end":{"line":405,"column":63}},"24":{"start":{"line":410,"column":8},"end":{"line":410,"column":80}},"25":{"start":{"line":422,"column":8},"end":{"line":422,"column":70}},"26":{"start":{"line":424,"column":8},"end":{"line":424,"column":38}},"27":{"start":{"line":436,"column":8},"end":{"line":437,"column":36}},"28":{"start":{"line":439,"column":8},"end":{"line":511,"column":9}},"29":{"start":{"line":440,"column":12},"end":{"line":448,"column":45}},"30":{"start":{"line":453,"column":12},"end":{"line":505,"column":13}},"31":{"start":{"line":454,"column":16},"end":{"line":504,"column":19}},"32":{"start":{"line":456,"column":24},"end":{"line":456,"column":43}},"33":{"start":{"line":457,"column":24},"end":{"line":457,"column":59}},"34":{"start":{"line":461,"column":24},"end":{"line":461,"column":66}},"35":{"start":{"line":464,"column":24},"end":{"line":464,"column":43}},"36":{"start":{"line":465,"column":24},"end":{"line":465,"column":59}},"37":{"start":{"line":466,"column":24},"end":{"line":466,"column":66}},"38":{"start":{"line":469,"column":24},"end":{"line":469,"column":43}},"39":{"start":{"line":470,"column":24},"end":{"line":470,"column":59}},"40":{"start":{"line":471,"column":24},"end":{"line":471,"column":66}},"41":{"start":{"line":476,"column":24},"end":{"line":476,"column":63}},"42":{"start":{"line":478,"column":24},"end":{"line":480,"column":54}},"43":{"start":{"line":486,"column":24},"end":{"line":487,"column":54}},"44":{"start":{"line":489,"column":24},"end":{"line":492,"column":25}},"45":{"start":{"line":490,"column":28},"end":{"line":491,"column":80}},"46":{"start":{"line":494,"column":24},"end":{"line":497,"column":25}},"47":{"start":{"line":495,"column":28},"end":{"line":496,"column":77}},"48":{"start":{"line":499,"column":24},"end":{"line":502,"column":25}},"49":{"start":{"line":500,"column":28},"end":{"line":501,"column":79}},"50":{"start":{"line":510,"column":12},"end":{"line":510,"column":38}},"51":{"start":{"line":521,"column":8},"end":{"line":523,"column":9}},"52":{"start":{"line":522,"column":12},"end":{"line":522,"column":57}},"53":{"start":{"line":536,"column":8},"end":{"line":536,"column":80}},"54":{"start":{"line":679,"column":0},"end":{"line":681,"column":17}}},"branchMap":{"1":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"2":{"line":285,"type":"binary-expr","locations":[{"start":{"line":285,"column":15},"end":{"line":285,"column":24}},{"start":{"line":285,"column":28},"end":{"line":285,"column":45}},{"start":{"line":286,"column":12},"end":{"line":286,"column":57}}]},"3":{"line":303,"type":"binary-expr","locations":[{"start":{"line":303,"column":15},"end":{"line":303,"column":24}},{"start":{"line":303,"column":28},"end":{"line":303,"column":44}},{"start":{"line":304,"column":12},"end":{"line":304,"column":56}}]},"4":{"line":318,"type":"binary-expr","locations":[{"start":{"line":318,"column":36},"end":{"line":318,"column":44}},{"start":{"line":318,"column":48},"end":{"line":318,"column":50}}]},"5":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":16},"end":{"line":369,"column":16}},{"start":{"line":369,"column":16},"end":{"line":369,"column":16}}]},"6":{"line":405,"type":"binary-expr","locations":[{"start":{"line":405,"column":36},"end":{"line":405,"column":55}},{"start":{"line":405,"column":59},"end":{"line":405,"column":61}}]},"7":{"line":422,"type":"cond-expr","locations":[{"start":{"line":422,"column":45},"end":{"line":422,"column":56}},{"start":{"line":422,"column":59},"end":{"line":422,"column":69}}]},"8":{"line":439,"type":"if","locations":[{"start":{"line":439,"column":8},"end":{"line":439,"column":8}},{"start":{"line":439,"column":8},"end":{"line":439,"column":8}}]},"9":{"line":453,"type":"if","locations":[{"start":{"line":453,"column":12},"end":{"line":453,"column":12}},{"start":{"line":453,"column":12},"end":{"line":453,"column":12}}]},"10":{"line":478,"type":"binary-expr","locations":[{"start":{"line":478,"column":42},"end":{"line":478,"column":56}},{"start":{"line":479,"column":28},"end":{"line":480,"column":53}}]},"11":{"line":486,"type":"binary-expr","locations":[{"start":{"line":486,"column":44},"end":{"line":486,"column":60}},{"start":{"line":487,"column":28},"end":{"line":487,"column":53}}]},"12":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":24},"end":{"line":489,"column":24}},{"start":{"line":489,"column":24},"end":{"line":489,"column":24}}]},"13":{"line":494,"type":"if","locations":[{"start":{"line":494,"column":24},"end":{"line":494,"column":24}},{"start":{"line":494,"column":24},"end":{"line":494,"column":24}}]},"14":{"line":499,"type":"if","locations":[{"start":{"line":499,"column":24},"end":{"line":499,"column":24}},{"start":{"line":499,"column":24},"end":{"line":499,"column":24}}]},"15":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"16":{"line":536,"type":"binary-expr","locations":[{"start":{"line":536,"column":15},"end":{"line":536,"column":27}},{"start":{"line":536,"column":32},"end":{"line":536,"column":54}},{"start":{"line":536,"column":58},"end":{"line":536,"column":78}}]}},"code":["(function () { YUI.add('datatable-base', function (Y, NAME) {","","/**","A Widget for displaying tabular data. The base implementation of DataTable","provides the ability to dynamically generate an HTML table from a set of column","configurations and row data.","","Two classes are included in the `datatable-base` module: `Y.DataTable` and","`Y.DataTable.Base`.","","@module datatable","@submodule datatable-base","@main datatable","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","A Widget for displaying tabular data. Before feature modules are `use()`d,","this class is functionally equivalent to DataTable.Base. However, feature","modules can modify this class in non-destructive ways, expanding the API and","functionality.","","This is the primary DataTable class. Out of the box, it provides the ability","to dynamically generate an HTML table from a set of column configurations and","row data. But feature module inclusion can add table sorting, pagintaion,","highlighting, selection, and more.","","
","// The functionality of this table would require additional modules be use()d,","// but the feature APIs are aggregated onto Y.DataTable.","// (Snippet is for illustration. Not all features are available today.)","var table = new Y.DataTable({"," columns: ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true },"," { key: 'lastName', sortable: true },"," { key: 'role', formatter: toRoleName }"," ],"," data: {"," source: 'http://myserver.com/service/json',"," type: 'json',"," schema: {"," resultListLocator: 'results.users',"," fields: ["," 'username',"," 'firstName',"," 'lastName',"," { key: 'role', type: 'number' }"," ]"," }"," },"," recordType: UserModel,"," pagedData: {"," location: 'footer',"," pageSizes: [20, 50, 'all'],"," rowsPerPage: 20,"," pageLinks: 5"," },"," editable: true","});","
","","### Column Configuration","","The column configurations are set in the form of an array of objects, where","each object corresponds to a column. For columns populated directly from the","row data, a 'key' property is required to bind the column to that property or","attribute in the row data.","","Not all columns need to relate to row data, nor do all properties or attributes","of the row data need to have a corresponding column. However, only those","columns included in the `columns` configuration attribute will be rendered.","","Other column configuration properties are supported by the configured","`view`, class as well as any features added by plugins or class extensions.","See the description of DataTable.TableView and its subviews","DataTable.HeaderView, DataTable.BodyView, and DataTable.FooterView (and other","DataTable feature classes) to see what column properties they support.","","Some examples of column configurations would be:","","","// Basic","var columns = [{ key: 'firstName' }, { key: 'lastName' }, { key: 'age' }];","","// For columns without any additional configuration, strings can be used","var columns = ['firstName', 'lastName', 'age'];","","// Multi-row column headers (see DataTable.HeaderView for details)","var columns = ["," {"," label: 'Name',"," children: ["," { key: 'firstName' },"," { key: 'lastName' }"," ]"," },"," 'age' // mixing and matching objects and strings is ok","];","","// Including columns that are not related 1:1 to row data fields/attributes","// (See DataTable.BodyView for details)","var columns = ["," {"," label: 'Name', // Needed for the column header"," formatter: function (o) {"," // Fill the column cells with data from firstName and lastName"," if (o.data.age > 55) {"," o.className += ' senior';"," }"," return o.data.lastName + ', ' + o.data.firstName;"," }"," },"," 'age'","];","","// Columns that include feature configurations (for illustration; not all","// features are available today).","var columns = ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'lastName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'age', emptyCellValue: 'unknown' }","];","
","","### Row Data Configuration","","The `data` configuration attribute is responsible for housing the data objects","that will be rendered as rows. You can provide this information in two ways by default:","","1. An array of simple objects with key:value pairs","2. A ModelList of Base-based class instances (presumably Model subclass"," instances)","","If an array of objects is passed, it will be translated into a ModelList filled","with instances of the class provided to the `recordType` attribute. This","attribute can also create a custom Model subclass from an array of field names","or an object of attribute configurations. If no `recordType` is provided, one","will be created for you from available information (see `_initRecordType`).","Providing either your own ModelList instance for `data`, or at least Model","class for `recordType`, is the best way to control client-server","synchronization when modifying data on the client side.","","The ModelList instance that manages the table's data is available in the `data`","property on the DataTable instance.","","","### Rendering","","Table rendering is a collaborative process between the DataTable and its","configured `view`. The DataTable creates an instance of the configured `view`","(DataTable.TableView by default), and calls its `render()` method.","DataTable.TableView, for instance, then creates the `` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," ",""," This is actually just a pass through to the `view` instance's method"," by the same name.",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (/* seed, shift */) {"," return this.view && this.view.getCell &&"," this.view.getCell.apply(this.view, arguments);"," },",""," /**"," Returns the ` |