Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 44 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | import { |
||
|
|||
2 | Row |
||
3 | } from './row.js'; |
||
4 | import { |
||
5 | HeaderCell |
||
6 | } from './celltypes/header.js'; |
||
7 | /** |
||
8 | HeaderRow is a controller for a row of header cells. |
||
9 | |||
10 | @class Backgrid.HeaderRow |
||
11 | @extends Backgrid.Row |
||
12 | */ |
||
13 | var HeaderRow = Row.extend({ |
||
14 | |||
15 | /** |
||
16 | Initializer. |
||
17 | |||
18 | @param {Object} options |
||
19 | @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns |
||
20 | @param {Backgrid.HeaderCell} [options.headerCell] Customized default |
||
21 | HeaderCell for all the columns. Supply a HeaderCell class or instance to a |
||
22 | the `headerCell` key in a column definition for column-specific header |
||
23 | rendering. |
||
24 | |||
25 | @throws {TypeError} If options.columns or options.collection is undefined. |
||
26 | */ |
||
27 | initialize: function () { |
||
28 | Row.prototype.initialize.apply(this, arguments); |
||
29 | }, |
||
30 | |||
31 | makeCell: function (column, options) { |
||
32 | var headerCell = column.get("headerCell") || options.headerCell || HeaderCell; |
||
33 | headerCell = new headerCell({ |
||
34 | column: column, |
||
35 | collection: this.collection |
||
36 | }); |
||
37 | return headerCell; |
||
38 | } |
||
39 | |||
40 | }); |
||
41 | |||
42 | export { |
||
43 | HeaderRow |
||
44 | }; |
||
45 |