enableAutoHeight

Hello,



I have a grid with AutoHeight, AutoWidth = true. I need these settings to make grid resize after I show or hide multiple rows in it.

(actually a single row or all the rows) Problem is: after I hide rows and have a single row left grid reduces it’s height incorrectly.

This “only row” appears inside of horizontal and vertical scrollbars. This grid’s behaviour is not stable and appears on my dev machine and machine of 1 our client. Problem was found on IE8 (in compatibility mode). Btw if you run page/grid without compat. mode and hide rows, then grid will not reduce it’s size at all.



Here is my code:

// hide paging controls

var div = window.document.getElementById(“divMainGridPaging”);

div.style.display = “none”;

div = window.document.getElementById(“divMainGridRecInfo”);

div.style.display = “none”;

mygrid.startFastOperations();

// hide all rows except the clicked one

var ClickedRowIndex = 0;

for (var i = 0; i < mygrid.getRowsNum(); i++)

{

var id = mygrid.getRowId(i);

if (id != RowId)

mygrid.setRowHidden(id, true);

else

ClickedRowIndex = i;

}

mygrid.stopFastOperations();

// thisis init code

function InitGridXML()

{

mygrid = new dhtmlXGridObject(‘divMainGrid’);

mygrid.setHeader(" ,Association,Mgmt,Account,Address,Firm FileNo,Mgmt FileNo,Matter Type,Last Action,Next Action,Balance");

mygrid.setColAlign(“center,center,left,left,left,left,left,left,left,left,left,right”);

mygrid.setInitWidths(str_width);

mygrid.setImagePath(“images”);

mygrid.setColTypes(“ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro”);

mygrid.setColSorting(“str,str,str,str,str,str,str,str,str,str,int”);

mygrid.enablePaging(true, 50, 10, “divMainGridPaging”, true, “divMainGridRecInfo”);

mygrid.setPagingSkin(“bricks”);

mygrid.setSkin(‘xp’);

mygrid.enableDragAndDrop(true);

mygrid.enableAutoHeight(true, 250);

mygrid.enableAutoWidth(true);

mygrid.setSizes();

mygrid.init();

}



Thanks,



Vlad

What version of dhtmlxGrid and doctype do you use? Can you please provide complete example where we can reproduce this issue? (You can send such example directly to the support@dhtmlx.com)


Version is: dhtmlxGrid v.1.5 Standard edition build 71114

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

I'll ask boss if he allows me to send you login to the web site, data and example, I think he would allow. Grid is used in our asp.net web site.

Vlad
 

A lot of similar issues was fixed since dhtmlxGrid v.1.5 Standard edition build 71114. Please try to update your files dhtmlx.com/docs/download.shtml