<script type="text/javascript">
var hide1 = true;
var hide2 = true;
var hide3 = true;
function hideColumn1(tableId, colIndex,hideType,ColumnValue) {
var table = document.getElementById(tableId);
if (table != null) {
for (i = 0; i < table.rows.length; i++) {
if (hideType)
table.rows[i].cells[colIndex - 1].style.display = 'none';
else
table.rows[i].cells[colIndex - 1].style.display = '';
}
if(ColumnValue == "Column1")
{
hide1 = !hideType;
}
if(ColumnValue == "Column2")
{
hide2 = !hideType;
}
if(ColumnValue == "Column3")
{
hide3 = !hideType;
}
}
}
</script>
you are just hiding the column and updating the variable hide1,hide2,hide3. so i just updated the your function .
1. added to more parameter into your function.
2. hidetype pass the current status of variable (true/false)
3. columnValue pass the you coumn id. fot that you were written diff function.
4. at last check the column value and on the basis of that set the variable status.
hope it will be help.