Hi there,
i am working on telerik. I want the height and width of my grid should reduce according to window size. For this i am using one java script. This javascript is working for IE and opera,but not working for mozilla. Means, i want to say that by using javascript my grid height and width is getting reduce for IE and opera, but when i will come to Mozilla the height and width is not getting reduce. The javascript coding i am using is:
<script type="text/javascript">
window.onresize = reSize;
function reSize()
{
grid = document.getElementById('<%=rgCustomer.ClientID %>');
h = 0;
if(!window.innerWidth)
{
if(!(document.documentElement.clientWidth == 0))
{
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
}
else
{
w = document.body.clientWidth;
h = document.body.clientHeight;
}
}
else
{
w = window.innerWidth-20;
h = window.innerHeight-50;
}
if(h-185 > 120)
{
grid.style.height = h-185;
}
else
{
gridhgt = 15+(grid.getRowCount()*grid.getRowHeight())+grid.getHeaderHeight();
if(120>gridhgt)
{
if(gridhgt<75 && grid.getRowCount()>=1)
grid.setStyle("height", 75);
else if(gridhgt<75)
grid.setStyle("height", 57);
}
else
{
grid.style.height = 120;
}
}
if(w-40 > 100)
{
grid.style.width = w-40;
}
else
{
grid.style.width = 100;
}
};
</script>
Can anybody help me to come out of this problem.
Regards.
Vimal Kumar Srivastava
Madhepura,Bihar
i am working on telerik. I want the height and width of my grid should reduce according to window size. For this i am using one java script. This javascript is working for IE and opera,but not working for mozilla. Means, i want to say that by using javascript my grid height and width is getting reduce for IE and opera, but when i will come to Mozilla the height and width is not getting reduce. The javascript coding i am using is:
<script type="text/javascript">
window.onresize = reSize;
function reSize()
{
grid = document.getElementById('<%=rgCustomer.ClientID %>');
h = 0;
if(!window.innerWidth)
{
if(!(document.documentElement.clientWidth == 0))
{
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
}
else
{
w = document.body.clientWidth;
h = document.body.clientHeight;
}
}
else
{
w = window.innerWidth-20;
h = window.innerHeight-50;
}
if(h-185 > 120)
{
grid.style.height = h-185;
}
else
{
gridhgt = 15+(grid.getRowCount()*grid.getRowHeight())+grid.getHeaderHeight();
if(120>gridhgt)
{
if(gridhgt<75 && grid.getRowCount()>=1)
grid.setStyle("height", 75);
else if(gridhgt<75)
grid.setStyle("height", 57);
}
else
{
grid.style.height = 120;
}
}
if(w-40 > 100)
{
grid.style.width = w-40;
}
else
{
grid.style.width = 100;
}
};
</script>
Can anybody help me to come out of this problem.
Regards.
Vimal Kumar Srivastava
Madhepura,Bihar