attach header to a cell of layout


In my layout i would like to put a element html (it displays my logo, profile company) to header side and grid object in one cell of layout, Is it possible to attach header and grid in one/specific cell of layout, if not how to do my above scenario.

Thank You

Try the next

function doOnLoad() { //debugger; layout = new dhtmlXLayoutObject(document.body, "2U"); mygrid = new dhtmlXGridObject('gridbox'); mygrid.setImagePath("../codebase/imgs/"); mygrid.setSkin("dhx_skyblue"); mygrid.loadXML("../samples/dhtmlxGrid/common/gridH.xml"); layout.attachHeader("my_header"); }



Hello Darya,

Thank You very much for your replay, I’ve modified your code :

var layout;
		function doOnLoad() { //debugger;
         layout = new dhtmlXLayoutObject(document.body, "2U");
		 mygrid = new dhtmlXGridObject('gridbox');

But When i collapsed cell(“a”) there’s empty space beside the grid. What i want is my grid has the same behavior/dynamic (width, height etc) as we’re using attachgrid() method to attach grid in a cell of layout.

Thank You.

If is correct behaviour. Such situation will arise because you attach grid to the cell through the div.
You can try the next:

  1. onCollapse/onExpand and onPanelResizeFinish recount manually width of the grid
  2. use 3L pattern widthout header (hideHeader()) of the cell B and attachObject() to this cell - it will be your header (“green” div), plus setHeigth() and fixSize() added and attachGrid() to the cell C

Thank You Darya

You are welcome!