Cannot change column visibility after resize
I have created a "console" where a user can turn the visibility of columns on or off using checkboxes. This works fine, as does the resize functionality. However, after a resize the column visibility toggle stops working. Here is some code:
Code for checkbox event:
<code>
<input type="checkbox" onChange="colarray[0][0] = showHideCols(1, colarray[0][0],colarray[0][4]);" CHECKED>
</code>
colarray is a two dimensional javascript array containing user preferences for visibility, width and other properties.
Column visibility function:
<code>
function showHideCols(index, status, size) {
var stylesheet = document.styleSheets[document.styleSheets.length-1];
var colname = ".active-column-" + index;
width1 = "width:0px";
width2 = "width:" + size + "px";
if (status == true) {
status = 0;
stylesheet.addRule(colname, width1);
stylesheet.addRule(colname, "display: none");
} else {
status = 1;
stylesheet.addRule(colname, width2);
stylesheet.addRule(colname, "display: block");
}
return status;
}
</code>
This error occurs in both Firefox and IE. Any suggestions?
Code for checkbox event:
<code>
<input type="checkbox" onChange="colarray[0][0] = showHideCols(1, colarray[0][0],colarray[0][4]);" CHECKED>
</code>
colarray is a two dimensional javascript array containing user preferences for visibility, width and other properties.
Column visibility function:
<code>
function showHideCols(index, status, size) {
var stylesheet = document.styleSheets[document.styleSheets.length-1];
var colname = ".active-column-" + index;
width1 = "width:0px";
width2 = "width:" + size + "px";
if (status == true) {
status = 0;
stylesheet.addRule(colname, width1);
stylesheet.addRule(colname, "display: none");
} else {
status = 1;
stylesheet.addRule(colname, width2);
stylesheet.addRule(colname, "display: block");
}
return status;
}
</code>
This error occurs in both Firefox and IE. Any suggestions?
Morgan Whitney
August 22,