Hi,
I would like to share my code regarding hiding and showing rows in a grid - i hope someone find it useful
Description:
You can hide single rows and display them again without loosing the information that the row has been originally hidden.
Example:
rows with a clickable icon:
<img border="0" src="images/hide.png" height=16 width=16 alt="Hide" title="Hide" onClick="HideRow({ID_HERE});" />
and the code for “show all”:
[code] function HideRow(id) {
mygrid.getRowById(id).style.opacity = “0.4”;
mygrid.setRowHidden(id,true);
}
function ShowAll() {
IsAllShown = !IsAllShown;
if(!IsAllShown) {
for(i=1;i<mygrid.getRowsNum();i++) {
if(mygrid.getRowById(mygrid.getRowId(i)).style.vData =='hidden') {
mygrid.setRowHidden(mygrid.getRowId(i),true);
mygrid.getRowById(mygrid.getRowId(i)).style.vData = '';
}
}
} else {
for(i=1;i<mygrid.getRowsNum();i++) {
if(mygrid.getRowById(mygrid.getRowId(i)).style.display=='none') {
mygrid.setRowHidden(mygrid.getRowId(i),false);
mygrid.getRowById(mygrid.getRowId(i)).style.vData = 'hidden';
}
}
}
}
[/code]