Loading ...
Sorry, an error occurred while loading the content.

33683Re: Hidden columns in DataTable....

Expand Messages
  • santini.alberto
    Jul 2, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      > Well, of course you wouldn't, if you don't plan to show it, why could
      > you care to have a formatter?

      Good question! :)
      I use the information of the hidden column to change the background
      color of the row.

      var rowMarker = function (cell, rec, col, data) {
      if (data === 1) {
      markLevel1[rec.getId()] = rec;
      } else if (data === 2) {
      markLevel2[rec.getId()] = rec;
      } else if (data > 2) {
      markLevel3[rec.getId()] = rec;
      cell.innerHTML = data;
      YAHOO.widget.DataTable.Formatter.rowMarker = rowMarker;

      And when it fires the render event i do:

      var updateMarks = function () {
      Dom.getElementsByClassName('mark1', 'tr', 'tbl'), 'mark1');
      Dom.getElementsByClassName('mark2', 'tr', 'tbl'), 'mark2');
      Dom.getElementsByClassName('mark3', 'tr', 'tbl'), 'mark3');

      for (var recKey in markLevel1) {
      if (YAHOO.lang.hasOwnProperty(markLevel1, recKey)) {

      > However, if you plan those hidden fields to affect the formatting of
      > other fields, put the formatter in those fields. They have access to
      > the hidden fields through the oRecord argument. If you plan to affect
      > the row, then place a formatter in any of the visible columns, let the
      > value of that field pass through and do whatever else you meant for
      the row.

      Right! I didn't think about that.

      Thanks for the hint,
    • Show all 8 messages in this topic