:: 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(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);
}
});
Friday, April 24, 2009
Carlos
Monday, April 27, 2009
This topic is archived.
Back to support forum
Forum search