[CLOSED] How to use Floating, FloatingConfig for Toolbar

  1. #1

    [CLOSED] How to use Floating, FloatingConfig for Toolbar

    Hi,

    Could you give me an example for using Floating, FloatingConfig in Toolbar. Here is my code:
    @using Ext.Net.MVC
    @model dynamic
    
    @{
        Layout = null;
    }
    <head>
    </head>
    
    @Html.X().ResourceManager()
    @Html.X().Toolbar().Flat(true).Items(item => item.Add(Html.X().Button().Text("MyButton"))).Floating(true)
    How can I put the Toolbar in the top-right conner on the browser?

    If I use a ViewPort in my page, How can I put this toolbar always over the ViewPort and in the topright conner?
    Last edited by Daniil; May 08, 2012 at 11:34 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Here you are.

    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 v2 Example</title>
    
        <script type="text/javascript">
            var align = function (tb) {
                tb.alignTo(Ext.getBody(), 'tr-tr', [-10, 10]);
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server">
            <Listeners>
                <WindowResize Handler="align(#{Toolbar1});" />
            </Listeners>
        </ext:ResourceManager>
        <ext:Viewport runat="server">
                
        </ext:Viewport>
            
        <ext:Toolbar ID="Toolbar1" runat="server" Floating="true">
            <Items>
                <ext:Button runat="server" Text="Button1" />
                <ext:Button runat="server" Text="Button2" />
            </Items>
            <Listeners>
                <AfterRender Fn="align" Delay="50" />
            </Listeners>
        </ext:Toolbar>
    </body>
    </html>
    See also
    http://docs.sencha.com/ext-js/4-1/#!...t-cfg-floating
    http://docs.sencha.com/ext-js/4-1/#!....util.Floating
  3. #3
    Thanks for your help.
    But in Razor, I can not find Listeners in ResourceManager. How can I resolve this problem?
  4. #4
    Thanks for the report.

    The Listeners have been added, please update from SVN.

    Example
    @Html.X().ResourceManager().Listeners(ls =>
        ls.WindowResize.Handler = "alert('Resize');"  
    )

Similar Threads

  1. [CLOSED] Window floating with Y = 0
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 11, 2012, 3:13 PM
  2. Replies: 2
    Last Post: Nov 20, 2011, 11:45 AM
  3. Floating property for Ext.Panel is not working
    By anulall in forum 1.x Help
    Replies: 1
    Last Post: Jul 12, 2011, 12:05 PM
  4. Replies: 1
    Last Post: Nov 07, 2009, 6:26 PM
  5. Floating Panel in MasterPage
    By Emre in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 06, 2009, 4:27 AM

Posting Permissions