OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview This implements a table control. | 6 * @fileoverview This implements a table control. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('cr.ui', function() { | 9 cr.define('cr.ui', function() { |
10 const ListSelectionModel = cr.ui.ListSelectionModel; | 10 const ListSelectionModel = cr.ui.ListSelectionModel; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 }, | 82 }, |
83 set selectionModel(selectionModel) { | 83 set selectionModel(selectionModel) { |
84 if (this.list_.selectionModel != selectionModel) { | 84 if (this.list_.selectionModel != selectionModel) { |
85 if (this.dataModel) | 85 if (this.dataModel) |
86 selectionModel.adjustLength(this.dataModel.length); | 86 selectionModel.adjustLength(this.dataModel.length); |
87 this.list_.selectionModel = selectionModel; | 87 this.list_.selectionModel = selectionModel; |
88 } | 88 } |
89 }, | 89 }, |
90 | 90 |
91 /** | 91 /** |
| 92 * The table column model. |
| 93 * |
| 94 * @type {cr.ui.table.TableColumnModel} |
| 95 */ |
| 96 get header() { |
| 97 return this.header_; |
| 98 }, |
| 99 |
| 100 /** |
92 * Sets width of the column at the given index. | 101 * Sets width of the column at the given index. |
93 * | 102 * |
94 * @param {number} index The index of the column. | 103 * @param {number} index The index of the column. |
95 * @param {number} Column width. | 104 * @param {number} Column width. |
96 */ | 105 */ |
97 setColumnWidth: function(index, width) { | 106 setColumnWidth: function(index, width) { |
98 this.columnWidths_[index] = width; | 107 this.columnWidths_[index] = width; |
99 }, | 108 }, |
100 | 109 |
101 /** | 110 /** |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 * because table contents can contain controls that can be focused, and for | 242 * because table contents can contain controls that can be focused, and for |
234 * some purposes (e.g., styling), the table can still be conceptually focused | 243 * some purposes (e.g., styling), the table can still be conceptually focused |
235 * at that point even though it doesn't actually have the page focus. | 244 * at that point even though it doesn't actually have the page focus. |
236 */ | 245 */ |
237 cr.defineProperty(Table, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR); | 246 cr.defineProperty(Table, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR); |
238 | 247 |
239 return { | 248 return { |
240 Table: Table | 249 Table: Table |
241 }; | 250 }; |
242 }); | 251 }); |
OLD | NEW |