[CLOSED] How to set Gridpanel Height and Width Dynamically from Javascript

  1. #1

    [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.

        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]
  2. #2
  3. #3
    Thanks Daniil,

    it worked for me. you can close the thread.

Similar Threads

  1. [CLOSED] Gridpanel Auto Height and Width
    By hemantpatil in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 12, 2013, 3:36 PM
  2. [CLOSED] gridpanel store does not load dynamically from javascript
    By pattake in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 21, 2011, 6:31 PM
  3. [CLOSED] GridPanel Row Height and Wrap plus Column width
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 13, 2010, 12:48 PM
  4. [CLOSED] gridpanel height and width problem
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 04, 2010, 4:54 PM
  5. [CLOSED] gridpanel width/height refreshing issue
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 02, 2009, 5:29 PM

Tags for this Thread

Posting Permissions