Mar 14, 2013, 6:53 AM
[CLOSED] How to set Gridpanel Height and Width Dynamically from Javascript
Hi,
i want to set the Height and width of Gridpanel dynamically from jawascript function, which will be Called from ResourceManager -> Listeners -> WindowResize -> Handler.
what i want to achieve is Resize the gridpanel as per Client Area of browser.i m using fallowing javascript function to get client height, width and Usercontrol top, left. Gridpanel is place within the USercontrol.
i want to set the Height and width of Gridpanel dynamically from jawascript function, which will be Called from ResourceManager -> Listeners -> WindowResize -> Handler.
what i want to achieve is Resize the gridpanel as per Client Area of browser.i m using fallowing javascript function to get client height, width and Usercontrol top, left. Gridpanel is place within the USercontrol.
function alertSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
//window.alert( 'Width = ' + myWidth );
//window.alert( 'Height = ' + myHeight );
myTop = getTopPosition(document.getElementById('<%= GridPanel1.ClientID.ToString.Replace("App.", "") %>'));
myLeft = getLeftPosition(document.getElementById('<%= GridPanel1.ClientID.ToString.Replace("App.", "") %>'));
window.alert('Grid Top = ' + myTop + ' Grid Left = ' + myLeft);
}
Thanks in Advance.
Last edited by Daniil; Mar 14, 2013 at 9:59 AM.
Reason: [CLOSED]