:: Forum >> Version 2 >>

multiple templates per row, depending on data

Has anyone tried putting in multiple templates per row depending on the value of the day? Moreover, depending on the data we also make the cell editable or not editable.

Sample code:
stgyGridObj.setCellTemplate(function(colrow) {
   var 
uomStr  this.wmcGetCellValueByColName(stgyColsXPath,"uom",row);
   var 
sizeStr  this.wmcGetCellValueByColName(stgyColsXPath,"strategysize",row);
   var 
msIdStr  this.wmcGetCellValueByColName(stgyColsXPath,"measureset/measuresetid",row);
   var 
disable this.wmcGetCellValueByColName(stgyColsXPath,"disablemeasureoverride",row);
                        
   if (
col == ) {
      if ( 
uomStr.length == || sizeStr.length == || msIdStr =="0" ) {
         return 
this.getCellNormalTemplate(colrow);
      }
      else {
         return 
this.getCellCheckboxTemplate(colrow);
      }
   }
   else {
      if ( (
col == STGY_ENT_LVL_COL || col == STGY_EXT_LVL_COL) &&
    (
uomStr == "MV%" || uomStr.length == ) ) {
    
this.setCellEditable(false,col,row);                if ( msIdStr != "0" && disable != "true") {
                return 
this.getCellLinkTemplate(colrow);
    }
      }
      return 
this.getCellNormalTemplate(colrow);
   }
});
 
Friday, April 24, 2009
Although never tried that, your best bet could be a mix of the posts:

/javascript.forum.9483.5/setcelllink-and-how-can-i.html
/javascript.forum.9812.5/setcelllink-in-2-0.html
/javascript.forum.16791.2/hyperlinks.html
/javascript.forum.13178.4/suggestion-for-feature-cell-marker.html

Customizing some to make the links and/or cell-edit disable / by the event cell-click function to switch it all (and then row refresh). ??
HTH
Carlos
Monday, April 27, 2009



This topic is archived.

Back to support forum

Forum search