:: Forum >> Version 2 >>

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(colrow) {
          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
Tuesday, October 16, 2007
You should call getCellValue() methods otherwise there will be a circular reference -

obj.setCellText (function(colrow) {
  var 
valueformat;
  if (
this.getCellValue(4,row) == null) {
    
value this.getCellValue(3,row);
  } else {
    
value this.getCellValue(4,row);
  }
  
format this.getCellFormat(colrow);
  if (
format){
    return 
format.valueToText(value);
  }
  return 
value;
}, 
3); 
 
This code also adds formatting - remove it if it's not necessary.
Alex (ActiveWidgets)
Wednesday, October 17, 2007



This topic is archived.

Back to support forum

Forum search