3.2.0

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(col, row) {
   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 == 0 ) {
      if ( uomStr.length == 0 || sizeStr.length == 0 || msIdStr =="0" ) {
         return this.getCellNormalTemplate(col, row);
      }
      else {
         return this.getCellCheckboxTemplate(col, row);
      }
   }
   else {
      if ( (col == STGY_ENT_LVL_COL || col == STGY_EXT_LVL_COL) &&
    (uomStr == "MV%" || uomStr.length == 0 ) ) {
    this.setCellEditable(false,col,row);				if ( msIdStr != "0" && disable != "true") {
                return this.getCellLinkTemplate(col, row);
    }
      }
      return this.getCellNormalTemplate(col, row);
   }
});
April 24,
Although never tried that, your best bet could be a mix of the posts:

http://www.activewidgets.com/javascript.forum.9483.5/setcelllink-and-how-can-i.html
http://www.activewidgets.com/javascript.forum.9812.5/setcelllink-in-2-0.html
http://www.activewidgets.com/javascript.forum.16791.2/hyperlinks.html
http://www.activewidgets.com/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
April 27,

This topic is archived.

See also:


Back to support forum