obj.onCellClicked = function cellClickedOn(event, col, row){
//****clear out old highlight
while(lasti>=0 && lastj>=0) {
obj.getCellTemplate(lasti, lastj).setStyle("border", "1px solid threeddarkshadow");
lasti--;
lastj--;
}
while(lasti2>=0 && lastj2<obj.getRowCount()) {
obj.getCellTemplate(lasti2, lastj2).setStyle("border", "1px solid threeddarkshadow");
lasti2--;
lastj2++;
}
i=col*1;
j=row*1;
i2=col*1;
j2=row*1;
//****get to top end of diagonal
while(i>=0 && j>=0) {
i--;
j--;
}
//****highlight diagonal
while(i<obj.getColumnCount() && j<obj.getRowCount()) {
obj.getCellTemplate(i,j).setStyle("border", "3px solid red");
i++;
j++;
}
lastj=j-1;
lasti=i-1;
//****get to top end of diagonal
while(i2>=0 && j2<obj.getRowCount()) {
i2--;
j2++;
}
//****highlight diagonal
while(i2<obj.getColumnCount() && j2>=0) {
obj.getCellTemplate(i2,j2).setStyle("border", "3px solid orange");
i2++;
j2--;
}
lastj2=j2-1;
lasti2=i2+1;
obj.getCellTemplate(col,row).setStyle("border", "3px solid yellow");
};
This topic is archived.