[CLOSED] Panel swap drag drop on Button click

  1. #1

    [CLOSED] Panel swap drag drop on Button click

    Is it possible to implement swap two panels on the button click

    i want something like this
    https://examples1.ext.net/#/DragDrop...ropable_Panel/
    but the only dfference is that
    i just want to use two panels and i want the panel to be swaped on the button click
    e.g:If i click on button then the panel east and west should get swaped

    Thanks in Advanced
    Last edited by Daniil; Mar 14, 2012 at 1:22 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Sure, it's much more simple.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var swap = function () {
                ContainerWest.add(ContainerEast.items.get(0));
                ContainerEast.add(ContainerWest.items.get(0));
    
                ContainerWest.doLayout();
                ContainerEast.doLayout();
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Viewport runat="server" Layout="BorderLayout">
            <Items>
                <ext:Container 
                    ID="ContainerWest" 
                    runat="server" 
                    Region="West" 
                    Width="200" 
                    Layout="FitLayout">
                    <Items>
                        <ext:Panel runat="server" Title="West" Html="West" />
                    </Items>
                </ext:Container>
                <ext:Container runat="server" Region="Center">
                    <Items>
                        <ext:Button runat="server" Text="Swap">
                            <Listeners>
                                <Click Fn="swap" />
                            </Listeners>
                        </ext:Button>
                    </Items>
                </ext:Container>
                <ext:Container 
                    ID="ContainerEast" 
                    runat="server" 
                    Region="East" 
                    Width="200" 
                    Layout="FitLayout">
                    <Items>
                        <ext:Panel runat="server" Title="East" Html="East" />
                    </Items>
                </ext:Container>
            </Items>
        </ext:Viewport>
    </body>
    </html>
  3. #3
    Thanx a lot

Similar Threads

  1. [CLOSED] Checkbox is not able uncheck in grid panel with drag and drop
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 02, 2012, 6:13 AM
  2. [CLOSED] Drag and Drop Reordering inside a panel
    By jchau in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 10, 2011, 5:02 PM
  3. Replies: 0
    Last Post: Apr 06, 2010, 10:01 AM
  4. [CLOSED] MultiSelect with drag and drop, Drop listener
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 30, 2009, 8:25 AM
  5. [FIXED] Drag/Drop of Window out of panel
    By jetskij16 in forum Bugs
    Replies: 1
    Last Post: Apr 16, 2008, 5:06 PM

Posting Permissions