Menu/Toolbar in Layout ends up at the bottom of the page


#1

Dear sir/madam,

I have a Tabbar with 4 tabs and each has a Layout inside. One of the Layout containers should contain a Menu or Toolbar that changes per tab. However, the menu is placed completely at the bottom of the body.
The menu should end up in "Container_1 of my Layout, which I am trying to initiate through

layout.getCell(“Container_1”).attachHTML("<div id=\“menu_2\”>");

The same behavior is seen using Toolbar.
The full code is attached. Any help in identifying the issue here would be much appreciated.
Thank you very much!

test.php (4.7 KB)


#2

Hello. When I attach a menu component to a layout cell I do not use the attachHTML. I use a straight “attach” without any difficulties. Have you tried that? Here is an example of a working menu:
layout_container1.getCell(“row_menu”).attach(menu_bdl);


#3

Thank you, that seems to work. At least, the menu is where it supposed to be in the layout.
Using the attachHTML gives me a bit more flexibility though.

One of the problems, I realized, was that parsing the menu data without an active container (e.g. because of a typo or the container will first be specified upon action), places the menu at the bottom of the page. I have updated my script in my previous post.

Another interesting behavior occurs now. Although the menu is in the right place and it changes its data upon tab change just like I want, the menu content is placed below the page as soon as I hover my mouse over it. Changing the layout container size doesn’t affect this.
I would very much appreciate any tips. The updated script with reproducible behavior is in my first post.