I set up a layout. A Form or grid will put on the layout.
A toolbar or a grid related information (e.g. number of record in grid), I want put them into the layout header.
How about this method ?
I set up a layout. A Form or grid will put on the layout.
A toolbar or a grid related information (e.g. number of record in grid), I want put them into the layout header.
How about this method ?
This header?
Or this header?
Could you provide us an expecting resultn the picture?
Darya,
It is same as your pictures. But you attach and show in tab page.
And I want to attach and show in a layout header.
Thanks !
Sorry about tabs
I tried to ask you: if you wanted to attach it to the layout.cells(id)
If you want to poot toolbar in layout header, you need do something like this:
layout.cells("a").setText("<div id='tlb' style='width: 300px'></div>");
toolbar = new dhtmlXToolbarObject("tlb");
And apply some styles for toolbar:
table.dhtmlxLayoutPolyContainer_dhx_skyblue td.dhtmlxLayoutSinglePoly div.dhtmlxPolyInfoBar div.dhtmlxInfoBarLabel {top: 0}
.dhxtoolbar_hdrline_ll {display: none !important}
.dhxtoolbar_hdrline_l {display: none !important}
.dhxtoolbar_hdrline_rr {display: none !important}
.dhxtoolbar_hdrline_r {display: none !important}
.dhx_toolbar_base_18_dhx_skyblue, .dhx_toolbar_base_24_dhx_skyblue, .dhx_toolbar_base_32_dhx_skyblue, .dhx_toolbar_base_48_dhx_skyblue {background-image: none !important}
If you want to attach form and grid in the same cell i recommend you attach in this cell 2U (i.e.) layout, hide headers and attach these components the common way: attachForm() and attachGrid()
Darya,
I want to ask more about attach information to layout header.
I attach a grid to a layout. I want to input information of the grid to the layout header.
e.g. number of record in the grid and some text title.
As a result, I want to put it’s information to the layout header.
How about it ?
Something like this:
dhxLayout = new dhtmlXLayoutObject("parentId", "2U");
dhxGrid = dhxLayout.cells("a").attachGrid();
dhxGrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
dhxLayout.cells("a").setText("<div id='tlb' style='width: 150px'></div>");
toolbar = new dhtmlXToolbarObject("tlb");
toolbar.setIconsPath("../___img/");
toolbar.addButton('printbtn', 0, '', 'print.ico'); //you've already for this button - i've placed it
toolbar.addText("text", 1, "");
dhxGrid.loadXML("../___xml/grid.xml", function(){
toolbar.setItemText("text", dhxGrid.getRowsNum());
});
Darya,
I find some error in your code.
Firstly, I can attach the toolbar in the layout header and work but the toolbar only can adjust the width and not in the heigth. Maybe it will need to adjust the layout header heigth or toolbar ?
Secondly, I use the gird in layout, I only want to put the ‘text’ and related to gird information to the layout header. But not attach a toolbar and text in header. You can verify it or other information ?
Thanks !
dhxLayout = new dhtmlXLayoutObject("parentId", "2U");
dhxGrid = dhxLayout.cells("a").attachGrid();
dhxGrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
dhxGrid.loadXML("../___xml/grid.xml", function(){
dhxLayout.cells("a").setText(dhxGrid.getRowsNum());
});