Dropdown menues disappear when parent panel is moved.

  1. #1

    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?


    @{
        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.

Similar Threads

  1. Replies: 1
    Last Post: May 30, 2015, 6:45 PM
  2. [CLOSED] How to pass parameters from child panel to parent panel ???
    By elbanna23 in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Jun 18, 2014, 4:04 PM
  3. Replies: 5
    Last Post: Oct 28, 2013, 12:22 PM
  4. Replies: 6
    Last Post: Jan 28, 2012, 1:14 AM
  5. Replies: 2
    Last Post: May 14, 2011, 6:29 PM

Posting Permissions