How do I insert 2 toolbars on the same layout cell?

How do I insert 2 toolbars on the same layout cell?

Can i clarify the reason of such implementation to help you?

Hi Darya,

For some layouts, it nice to have a toolbar below the attachURL. For example, look at MS Word 2012. They show status and allow layout changes from the toolbar below.

As a side, as of dhtmlX 4.x, getFrame will return the bottom object in the container (assumes toolbar, etc. is first, then iframe is below that). So, if you reversed them (iframe then toolbar), getFrame would return the toolbar…

Below is my fix for this issue:

dhtmlXCellObject.prototype.getFrame = dhtmlXCellObject.prototype._getFrame = function () { if (this.dataType != "url") { return null; } var returnCell = null; var numberOfChildNodes = this.cell.childNodes.length; for (var i = 0; i < numberOfChildNodes; i++) { if (this.cell.childNodes[i].nodeType === 1) { if (this.cell.childNodes[i].className.indexOf("dhx_cell_cont_tabbar") != -1) { returnCell = this.cell.childNodes[i].firstChild; break; } } } return returnCell; };

Once you have a working getFrame, it is easy enough to move the toolbar where you need it.

ifr.parentNode.parentNode.insertBefore(ifr.parentNode, ifr.parentNode.previousSibling);

where ifr if the iframe.

It would be great if attachToolbar could be extended to choose top or bottom, or if there was a position parameter that could be used with all the attach functions allowing you to choose the order of the items…

Cheers,

Alex

I have limited space in my layout. I want to add several toolbar buttons i a toolbar, however, once I add a button which exceeds the toolbar width, the button is not shown. So, I’ve decided to add another toolbar below an existing toolbar, but when I attach the new toolbar to the same layout cell as the existing toolbar, the new toolbar is not shown.

You can only use attachObject method to attach to the layout’s cell div with divs for toolbar1, toolbar2 and content.
Every new attached toolbar will remove previous

To make your toolbar more flexible you can try to use dhtmlxRibbon:
dhtmlx.com/docs/products/dhtmlxRibbon/samples/

I’ll try to use ribbon. Thanks.

By the way, can I add combo in ribbon?

There is no public approach, but you can try to use this topic:
viewtopic.php?f=4&t=37286&p=115665&hilit=ribbon#p115665