3.2.0

Problem with assigning columns info/values

Ok, this is definitely MY issue, but I'm hoping someone can tell me what I'm doing wrong.

I have 2 date columns (column 3 and 4) - both set as the date format.

But, when the date in Column 4 exists, I want it to overwrite the date in Coliumn 3 (as I'm only showing Column 3 in the grid.

// RevisedInServiceDate over-rides ISAInServiceDate if there is a value
     obj.setCellText (function(col, row) {
          if (obj.getCellValue(4,row) == null) {
               return this.getCellText(3,row);
          } else {
               return this.getCellText(4,row);
          }
     }, 3);


I've tried variations of the getCellText and getCellValue without much success. In fact, in some cases, it gives and out of memoiry error.

Oh, also, the source of the data is XML - if that matters.

Any help would be appreciated.
Carl
October 16,
You should call getCellValue() methods otherwise there will be a circular reference -

obj.setCellText (function(col, row) {
  var value, format;
  if (this.getCellValue(4,row) == null) {
    value = this.getCellValue(3,row);
  } else {
    value = this.getCellValue(4,row);
  }
  format = this.getCellFormat(col, row);
  if (format){
    return format.valueToText(value);
  }
  return value;
}, 3);


This code also adds formatting - remove it if it's not necessary.
Alex (ActiveWidgets)
October 17,

This topic is archived.

See also:


Back to support forum