Resizing dhtmlx accordian containing a grid with sub_row_aja

Hi,

We have dhtmlxSuite_v25_pro_91111 professional license.

We have a dhtmlXAccordian control displayed in multimode with a lot of accordian cell items, in each cell we have dhtmlx grid with a sub_row_ajax.
On a action in the grid we display the sub_row_ajax and hide it based on a action performed on sub_row_rajax, this has been done easily by attaching events on the grid.
But, we also want to adjust the height of the accordian cell item and the grid within so that the all the content of the sub_row_ajax is completely visible.

What are the possible approaches to get the above done.

Thanks

Hi,

there is not a ready solution for that.

Try to following (not sure that it’ll work):

dhxAccord = new dhtmlXAccordion("accordObj"); dhxAccord.addItem("a1", "Grid"); var grid = dhxAccord.cells("a1").attachGrid();

  1. enable auto height mode:
grid.enableAutoHeight(true)
  1. then set onSubAjaxLoad event handler that will change the heights of the accordion container and the cell with the grid:

[code]grid.attachEvent(“onSubAjaxLoad”,function(rId){
window.setTimeout(function(){
var gridHeight = grid.entBox.offsetHeight;
dhxAccord.cells(“a1”).setHeight(gridHeight);
document.getElementById(“accordObj”).style.height = grid.entBox.offsetHeight+300+“px”;
},1)

})[/code]

I’ve used 300 in the example. Instead of this value you should use another value (the total height of the other cells in the accordion) .

Hi,

Thanks for the reply, I am in process of trying this out, justa quick question, how does one determine the total height of all the accordion, as I couldn’t find any method to find height of individual accordian cells.

Thanks

Hi,

by default the height of an item in multi mode is 90px. But you may change it by setHeight method:

dhxAccord.cells(itemId).setHeight(itemHeight);

Hi,
We tried this option but this worked only when we don’t use multiple feature.
After we started using enableMultiline the height returned by grid.entbox.offsetHeight was less than actual. Because of which accord height cell was getting set to some less value and some of the rows were not visible.
How should we get height of grid in multiline mode ?

Thanks,
Suneet

Hi,

Could provide the demo to reproduce the problem locally ? Please don’t include libraries in the demo (as they are from PRO edition)