Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ersin Kaplan on Aug 06, 2009 04:39
open dhtmlx forum
More than one element in layout cell

Dear DHX Team,

We would like to use the DHTMLX layout, unfortunately, the are some issues regarding the bodywork of the cell.
As we would like to put in more than one element in the cell e.g. a dhtmlxMenu, dhtmlxGrid + Buttons and a dhtmlxStatusbar, it would be greate to be able to add HTML-Strings.

Thank you very much, I really appricate your assistants.

Regards,

Ersin Kaplan
Answer posted by Alex (support) on Aug 06, 2009 05:03

Hello, 

  there are special methods to add menu, grid and statusbar: attachMenu, attachGrid and attachStatusBar. Please, see samples dhtmlxLayout/samples/components/

 You can call this methods for one cell.

Answer posted by Ersin Kaplan on Aug 06, 2009 05:15
Hi Alex,

thanks for the quick answer.
We don't have the problem to put one element into the cell.
We would like to put more than one element in the cell e.g. 3 or 4 elements in one Cell.

//first element
    var status = dhxmain.attachStatusBar();
    dhxmain.items[1].attachObject(status);
    status.setText("Content-Status");

//second element
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.imgURL = "dhtmlxGrid/codebase/imgs/";
    mygrid.setHeader("Column A, Column B");
    mygrid.attachHeader("#connector_text_filter,#connector_text_filter");
    mygrid.setInitWidths("200,200");
    mygrid.setColTypes("edtxt,ed");
    mygrid.setColSorting("connector,connector");
    mygrid.enableSmartRendering(true);
    mygrid.enableMultiselect(true);
    mygrid.init();
    mygrid.loadXML("grid_connector.php");
   
    var dp = new dataProcessor("grid_connector.php");
    dp.init(mygrid);

    var xxx = document.getElementById("gridbox");
    dhxmain.items[1].attachObject(xxx);

After the second element created the first element will be overwritten

Regards,

Ersin Kaplan


Answer posted by Alex (support) on Aug 06, 2009 06:10

Try to use the same approach as in the layout samples:

var status = dhxLayout.cells("a").attachStatusBar();
...
var grid = dhxLayout.cells("a").attachGrid();
...
var menu = dhxLayout.cells("a").attachMenu();
...