Nov 26, 2017, 7:33 PM
Dropdown menues disappear when parent panel is moved.
Here's an example scenario:
A panel inside a window has a drop-down menu inside it.
We move the panel to a different window.
Then the drop-down menu appears behind the window.
If the first window was hidden, then the drop-down menu will totally disappear too.
Is there a way to fix this so that the menu displays correctly after the move?
A panel inside a window has a drop-down menu inside it.
We move the panel to a different window.
Then the drop-down menu appears behind the window.
If the first window was hidden, then the drop-down menu will totally disappear too.
Is there a way to fix this so that the menu displays correctly after the move?
@{
var x = Html.X();
}
@(
x.Panel()
.Title("Outer")
.ItemID("Outer")
.Items(
x.Window()
.ItemID("Source")
.Title("Source")
.Width(200)
.X(100)
.Items(
x.Panel()
.TopBar(x.Toolbar()
.Items(
x.Button().Text("1. Menu")
.Menu( x.Menu()
.Items(
x.MenuItem().Text("Item1"),
x.MenuItem().Text("Item2")
)
),
x.Button().Text("2. Move me")
.Handler(@"
var outer = this.up('#Outer');
var window = this.up('window');
// Hiding the first window (comment out and see
// that the dropdown-menu will appear behind
// the destination window):
window.hide();
var moveTo = window.itemId==='Source' ? 'Destination' : 'Source';
var moveToWin = outer.down('#'+moveTo);
var panelToMove = this.up('panel');
moveToWin.add(panelToMove);
")
)
)
)
,
x.Window()
.ItemID("Destination")
.Title("Destination")
.Width(200)
.X(400)
)
)
Last edited by sveins12; Nov 26, 2017 at 7:39 PM.