lsmith / yui3

YUI 3.x Source Tree
http://developer.yahoo.com/yui/3/
Other
7 stars 0 forks source link

Example: highlighting #26

Closed lsmith closed 11 years ago

lsmith commented 12 years ago

Three part example: 1) cell hover highlight 2) row hover highlight 3) column hover highlight

// cell highlighting
table.delegate('hover',
  function (e) { e.currentTarget.addClass('highlight'); },
  function (e) { e.currentTarget.removeClass('highlight'); },
  '.yui3-datatable-cell');

Change the selector for row highlighting. The column highlight would get the column name, then apply a class to the boundingBox, allowing the highlight to be applied by css cascade.

.highlight-foo .yui3-datatable .yui3-datatable-col-foo { /* background-color: ... */ }