Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
CSOM resize() function not working in 2008 Vol.1 !?!?!
posted

Hi All,

 I just upgraded to version 8.1.20081.100.

I used the Project Updgrade Utility to upgrade my project. Now I get a JavaScript error  when using the resize() function of the grid on clientside. The error occurs in ScriptResource.axd on line 6485 at this point:

...
var marginWidth = igtbl_dom.bordersWidth(this.MainGrid);
...

The bordersWidth funtion does not exist. When I look into the object I can find it under dimensions.bordersWidth.

How can I fix this as fast as possible??? I just upgraded because of the problems in version 7.2.

Thanks a lot

Bob 

  • 100
    posted

     resize method working well in verion 7.2

  • 200
    posted

    It's a bug. For the height it's used correctly. Thus I copied the sourcecode and wrote my own function. For everyone having the same problem here it is:

     

    function resizeGrid(grid, width, height)
    {
       
        width = (width<0)?0:width
        height = (height<0)?0:height
       
       
        if(!ig_csom.IsIE || ((ig_csom.IsIE6 || ig_csom.IsIE7) && igtbl_isXHTML))
        {
            // need to set the width first so we can see whether anything (groupby box) is going to
            // get taller or shorter because of changes to text wrapping
           
            var marginWidth = igtbl_dom.dimensions.bordersWidth(grid.MainGrid);
            grid.MainGrid.style.width = width + "px";
            document.getElementById(grid.Id + "_mc").style.width = (width - marginWidth) + "px";
           
           
            grid.MainGrid.style.height = 0 + "px";
           
            // measure how much space all the fixed elements are going to need
           
            var marginHeight =  igtbl_dom.dimensions.bordersHeight(grid.MainGrid);
            for(var x=0; x<grid.MainGrid.rows.length; x++)
            {
                if(grid.MainGrid.rows[x].id != grid.Id + "_mr")
                {
                    marginHeight += grid.MainGrid.rows[x].offsetHeight;
                }
            }
           
           
            if(height < marginHeight) {
                height = marginHeight;
            }
           
            // set the new widths and heights of the outer table and rows area
            grid.MainGrid.style.height = height + "px";
            document.getElementById(grid.Id + "_mr").style.height = (height - marginHeight) + "px";
            document.getElementById(grid.Id + "_mc").style.height = (height - marginHeight) + "px";
        } else {
            grid.MainGrid.style.width = width + "px";
            grid.MainGrid.style.height = height + "px";
        }

    }