views:

69

answers:

1

I've created a dijit popup menu that gets the items in the menu using a JSON AJAX request the first time that it is opened. My problem is that after the menu items have been added, the menu often goes outside the viewport of the browser, since the position of the menu has already been calculated by dojo. The second time that I open the menu, dojo correctly moves the menu so that it appears inside the browser viewport.

So, my question is, does anyone know of a way to ask the menu dijit to recalculate its x,y,w,h position after I've loaded the menu items using AJAX??

A: 

You can try to close and re-open the popup inside startup method of the parent widget or somewhere else (depending on your implementation).

Kniganapolke