hide cell data
I am trying out the trial version.
Managed to get the background of the cells with data red.
Next step is to hide the data in these cells because we don't want them to be publiced on the net
Tried a few things but no luck so far.
Can anyone give me a hint?
Thanks Mark
please check below on item set cell text.
How should this be made up?
var obj = new AW.Grid.Extended;
// new property for column span, default=1
obj.defineHeaderProperty("span", 1);
obj.setHeaderTemplate(new AW.Grid.Header2);
obj.setHeaderIndices([1,0]);
obj.setHeaderCount(2);
// refresh multi-span headers on width change
obj.adjustScrollWidth = function(){
var c, r, max = this.getColumnCount();
var a = this.getColumnIndices();
for (r=0; r<2; r++){
for (c=0; c<max; c++){
var row = r, col = a ? a[c] : c;
if (this.getHeaderSpan(c, r) > 1){
this.getHeaderTemplate(c, r).refresh();
}
}
}
}
// usage
obj.setHeaderSpan(2, 0, 1);
obj.setHeaderSpan(0, 1, 1); // col-1 spans across 3 columns
obj.setHeaderSpan(4, 2, 1); // col-2 span=0 (hidden)
obj.setHeaderSpan(0, 3, 1); // col-3 span=0 (hidden)
obj.setCellText(myData);
obj.setHeaderText(["Variety", "Flowertype", "wk 46", "wk 47", "wk 48","wk 49","wk50","wk51","wk 52","wk 1","wk 2","wk 3","wk 4","wk 5","wk 6","wk 7","wk 8","wk 9","wk 10","wk 11","wk 12","wk 13","wk 14","wk 15","wk 16","wk 17","wk 18"],0); // js array for the second row of headers
obj.setHeaderText(["Schedule 2006-2007","","Estimated Flowerweeks",""],1);
obj.defineCellProperty("background-color", function(col,row){
var value = this.getCellText(col,row);
var color = "";
if (value > 1) {color = "red" ;}
return color;
});
obj.getCellTemplate().setStyle("background-color", function(){return this.getControlProperty("background-color"); });
// obj.setCellText(
// function(col,row) {
//if (col!= 1) { return(myData); }
// var v = this.getCellText(col, row);
// if (v = "") {
// return "Low";
// } else {
// return;
// }
// }
// );
//obj.setCellText(function(col, row);
//obj.setCellText(function(col, row){
// var value1 = this.getCellText(col, row);
// var text1 = "";
// if (value1 > 1) {text1 ="x" ;}
// return text1;
// }); // calculate column 2 from columns 0 and 1
//obj.getCellTemplate().setStyle("text", function(){return this.getControlProperty("text"); });
obj.setColumnCount(27);
obj.setRowCount(60);
obj.setFixedLeft(2);
obj.setControlSize(750, 500);
// document.write(obj);
Managed to get the background of the cells with data red.
Next step is to hide the data in these cells because we don't want them to be publiced on the net
Tried a few things but no luck so far.
Can anyone give me a hint?
Thanks Mark
please check below on item set cell text.
How should this be made up?
var obj = new AW.Grid.Extended;
// new property for column span, default=1
obj.defineHeaderProperty("span", 1);
obj.setHeaderTemplate(new AW.Grid.Header2);
obj.setHeaderIndices([1,0]);
obj.setHeaderCount(2);
// refresh multi-span headers on width change
obj.adjustScrollWidth = function(){
var c, r, max = this.getColumnCount();
var a = this.getColumnIndices();
for (r=0; r<2; r++){
for (c=0; c<max; c++){
var row = r, col = a ? a[c] : c;
if (this.getHeaderSpan(c, r) > 1){
this.getHeaderTemplate(c, r).refresh();
}
}
}
}
// usage
obj.setHeaderSpan(2, 0, 1);
obj.setHeaderSpan(0, 1, 1); // col-1 spans across 3 columns
obj.setHeaderSpan(4, 2, 1); // col-2 span=0 (hidden)
obj.setHeaderSpan(0, 3, 1); // col-3 span=0 (hidden)
obj.setCellText(myData);
obj.setHeaderText(["Variety", "Flowertype", "wk 46", "wk 47", "wk 48","wk 49","wk50","wk51","wk 52","wk 1","wk 2","wk 3","wk 4","wk 5","wk 6","wk 7","wk 8","wk 9","wk 10","wk 11","wk 12","wk 13","wk 14","wk 15","wk 16","wk 17","wk 18"],0); // js array for the second row of headers
obj.setHeaderText(["Schedule 2006-2007","","Estimated Flowerweeks",""],1);
obj.defineCellProperty("background-color", function(col,row){
var value = this.getCellText(col,row);
var color = "";
if (value > 1) {color = "red" ;}
return color;
});
obj.getCellTemplate().setStyle("background-color", function(){return this.getControlProperty("background-color"); });
// obj.setCellText(
// function(col,row) {
//if (col!= 1) { return(myData); }
// var v = this.getCellText(col, row);
// if (v = "") {
// return "Low";
// } else {
// return;
// }
// }
// );
//obj.setCellText(function(col, row);
//obj.setCellText(function(col, row){
// var value1 = this.getCellText(col, row);
// var text1 = "";
// if (value1 > 1) {text1 ="x" ;}
// return text1;
// }); // calculate column 2 from columns 0 and 1
//obj.getCellTemplate().setStyle("text", function(){return this.getControlProperty("text"); });
obj.setColumnCount(27);
obj.setRowCount(60);
obj.setFixedLeft(2);
obj.setControlSize(750, 500);
// document.write(obj);
Mark Wester - Holland
October 14,