Add image to layout header panel

Hi,

Can we add image to right side corner of the layout where we set the text like below.
setText() will add a text to the cell at left corner. I want to add a image to the right corner. Is it possible?

dhxLayout = new dhtmlXLayoutObject(document.body, “1C”);
dhxLayout.cells(“a”).setText(“Home”);

-Nityajs

Can some one give me idea on this if its possible…

Hi
I think what it will be better to add toolbar to your layout and add such picture there.

dhxLayout = new dhtmlXLayoutObject(document.body, "1C"); dhxLayout.cells("a").hideHeader(); toolbar = dhxLayout.cells("a").attachToolbar(); toolbar.setIconsPath("___img/"); toolbar.addButton("picture", 0, "", "settings.gif", "settings.gif"); toolbar.setAlign('right')

It will be something like this:

Great! Can I add a text to the sme toolbar but it should be aligned to the left side. Can I acheive that with toolbar itself? Left side should be text and right side should be image.

In that case you can do the following:

dhxLayout = new dhtmlXLayoutObject(document.body, "1C"); dhxLayout.cells("a").hideHeader(); toolbar = dhxLayout.cells("a").attachToolbar(); toolbar.setIconsPath("___img/"); toolbar.addText("info", 0, "Text button"); toolbar.addSpacer("info"); //Moves apart items toolbar.addButton("picture", 1, "", "settings.gif", "settings.gif");

It works perfectly. Can I hide and show the image when ever required.

Yes, you can hide it.
This picture is an item of toolbar. It has the text methods to manipulate its items:

toolbar.addButton("picture", 1, "", "settings.gif", "settings.gif"); //adding of the button 'picture' toolbar.hideItem('picture'); //hiding this item toolbar.showItem('picture'); //showing this item

Thanks a lot!