[CLOSED] creating a portal with splitbar in ext.net 2.0

  1. #1

    [CLOSED] creating a portal with splitbar in ext.net 2.0

    Hi How do you add a splitbar in Ext.net 2.0 portal. In V1 the code below renders a portlet with a splitbar but V2 does not have ColumnLayoutConfig as the layout option

    <ext:Portal
            runat="server"
            Height="400"
            Width="400"
            Layout="ColumnLayout"
            AutoScroll="true"
            Cls="my-portal"
            BodyCssClass="no-horizontal-scroll">
            <LayoutConfig>
                <ext:ColumnLayoutConfig FitHeight="false" Split="true" />
            </LayoutConfig>
            <Items>
                <ext:PortalColumn
                    runat="server"
                    ColumnWidth=".5"
                    Layout="AnchorLayout"
                    DefaultAnchor="-20">
                    <Items>
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                    </Items>
                </ext:PortalColumn>
                <ext:PortalColumn
                    runat="server"
                    ColumnWidth=".5"
                    Layout="AnchorLayout"
                    DefaultAnchor="-20">
                    <Items>
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                        <ext:Portlet runat="server" Html="Some content" Height="200" />
                    </Items>
                </ext:PortalColumn>
            </Items>
        </ext:Portal>
    Last edited by Daniil; Feb 11, 2013 at 11:42 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Portal internally uses ColumnLayout and, unfortunately, it doesn't support splitting anymore.

    I would try to override the Portal using HBoxLayout which does support splitting.

    Though I can't estimate how difficult it might be. At least, I can't see a solution better for now.

    Please investigate the Portal sources.
    <Ext.NET sources root>\Ext.Net\Build\Ext.Net\ux\portal\portal.js
    I would start with this example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script type="text/javascript">
            Ext.app.PortalPanel.override({
                initComponent : function () {
                    var me = this;
    
                    // Implement a Container beforeLayout call from the layout to this Container
                    this.layout = {
                        type  : 'hbox',
                        align : 'stretch'
                    };
    
                    Ext.app.PortalPanel.superclass.initComponent.call(this);
    
                    this.addEvents({
                        validatedrop   : true,
                        beforedragover : true,
                        dragover       : true,
                        beforedrop     : true,
                        drop           : true
                    });
                    this.on('drop', this.doLayout, this);
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Portal 
            ID="Portal1" 
            runat="server" 
            Height="400" 
            Width="400">
            <Items>
                <ext:PortalColumn runat="server" Flex="1">
                    <Items>
                        <ext:Portlet runat="server" Title="Portlet 1" />
                        <ext:Portlet runat="server" Title="Portlet 2" />
                    </Items>
                </ext:PortalColumn>
                <ext:BoxSplitter runat="server" StyleSpec="background-color: green;" />
                <ext:PortalColumn runat="server" Flex="1">
                    <Items>
                        <ext:Portlet runat="server" Title="Portlet 3" />
                        <ext:Portlet runat="server" Title="Portlet 4" />
                    </Items>
                </ext:PortalColumn>
            </Items>
        </ext:Portal>
    </body>
    </html>
    Sure, needs more override to get it all working. Currently, for example, a JS error occurs on dragging. Though not always.

    Hope this helps.

    Here is the related thread on Sencha.
    Last edited by Daniil; Jul 25, 2012 at 12:46 AM.
  3. #3
    When I tried your code. I get the following error

    "Unknown server tag 'ext:BoxSplitter'."
  4. #4
    Please clarify what Ext.NET sources do you use?

    Please use RC2 or update from SVN.
  5. #5
    Ok. I got the latest release and it shows the splitter now. Can your team implement this feature into Ext.net. I believe it is a good feature to have I don't know why it was removed.

    Please let me know if this is something that would be done in a later release of V2. Instead of me poking around and making some changes that could cause other things to break, your team have the faculty to perform a proper testing of any workaround that does not throw JS errors.

    Regards
  6. #6
    We can consider it as a feature request to review in future.

    Though, unfortunately, I am not sure it will be implemented and can't provide you with any time frame.
  7. #7

Similar Threads

  1. Adding row to grid
    By Z in forum 1.x Help
    Replies: 7
    Last Post: Feb 14, 2012, 12:20 PM
  2. Adding Tab using codebehind
    By gevik in forum 1.x Help
    Replies: 9
    Last Post: Oct 02, 2011, 7:43 PM
  3. adding the same tab more than once
    By ozayExt in forum 1.x Help
    Replies: 1
    Last Post: Aug 22, 2011, 5:09 PM
  4. adding a contextmenu for the desktop
    By dreambe in forum 1.x Help
    Replies: 0
    Last Post: Feb 13, 2009, 3:52 AM
  5. Adding controls on the fly
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 27, 2008, 5:02 AM

Tags for this Thread

Posting Permissions