Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Patch to support title attribute for each column

  • Loading branch information...
commit de09a4acd0731b64cadf98a4761cf0f407995315 1 parent dedad6a
John Lindal authored
15 src/datatable/docs/index.mustache
@@ -1808,6 +1808,21 @@ pies.on('pie:slicesChange', function (e) {
1808 1808 <td>`datatable-base`</td>
1809 1809 </tr>
1810 1810 <tr>
  1811 + <td>title</td>
  1812 + <td>
  1813 + ```
  1814 + {
  1815 + key : 'forecast',
  1816 + label: '1yr Target Forecast',
  1817 + title: 'Target Forecast for the Next 12 Months'
  1818 + }
  1819 + ```
  1820 +
  1821 + <p>Assigns the value `<th title="HERE">`.</p>
  1822 + </td>
  1823 + <td>`datatable-base`</td>
  1824 + </tr>
  1825 + <tr>
1811 1826 <td>headerTemplate</td>
1812 1827 <td>
1813 1828 ```
15 src/datatable/js/head.js
@@ -56,6 +56,7 @@ Supported properties of the column objects include:
56 56 * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this
57 57 column only.
58 58 * `abbr` - The content of the 'abbr' attribute of the `<th>`
  59 + * `title` - The content of the 'title' attribute of the `<th>`
59 60 * `className` - Adds this string of CSS classes to the column header
60 61
61 62 Through the life of instantiation and rendering, the column objects will have
@@ -85,11 +86,11 @@ Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {
85 86
86 87 @property CELL_TEMPLATE
87 88 @type {HTML}
88   - @default '<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>'
  89 + @default '<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}{title}>{content}</th>'
89 90 @since 3.5.0
90 91 **/
91 92 CELL_TEMPLATE:
92   - '<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>',
  93 + '<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}{title}>{content}</th>',
93 94
94 95 /**
95 96 The data representation of the header rows to render. This is assigned by
@@ -189,7 +190,8 @@ Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {
189 190 defaults = {
190 191 _colspan: 1,
191 192 _rowspan: 1,
192   - abbr: ''
  193 + abbr: '',
  194 + title: ''
193 195 },
194 196 i, len, j, jlen, col, html, content, values;
195 197
@@ -213,11 +215,15 @@ Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {
213 215
214 216 values._id = col._id ?
215 217 ' data-yui3-col-id="' + col._id + '"' : '';
216   -
  218 +
217 219 if (col.abbr) {
218 220 values.abbr = ' abbr="' + col.abbr + '"';
219 221 }
220 222
  223 + if (col.title) {
  224 + values.title = ' title="' + col.title + '"';
  225 + }
  226 +
221 227 if (col.className) {
222 228 values.className += ' ' + col.className;
223 229 }
@@ -377,6 +383,7 @@ Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {
377 383 * `children` - Array of columns to appear below this column in the next
378 384 row.
379 385 * `abbr` - The content of the 'abbr' attribute of the `<th>`
  386 + * `title` - The content of the 'title' attribute of the `<th>`
380 387 * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells
381 388 in this column only.
382 389

0 comments on commit de09a4a

Please sign in to comment.
Something went wrong with that request. Please try again.