[CLOSED] ext:Image margin doesn't work in StyleSpec ?

  1. #1

    [CLOSED] ext:Image margin doesn't work in StyleSpec ?

    Hi @all,

    i have the following code

     <ext:Panel runat="server" ID="p_footer" Height="45" BodyStyle="border-left:#000000;border-right:#000000;border-top:#000000"
                                Layout="HBoxLayout">
                                <LayoutConfig>
                                    <ext:HBoxLayoutConfig Align="Middle" Padding="0">
                                    </ext:HBoxLayoutConfig>
                                </LayoutConfig>
                                <Items>                              
                                    <ext:Image ID="i_handup" StyleSpec="cursor:pointer;margin-top:5px" runat="server" ImageUrl="/Resources/handup_gray_light16.png" Height="16" Width="16">
                                    </ext:Image>                               
                                </Items>
                            </ext:Panel>
    The "margin-top" doesn't work...

    Any idea ??

    Thanks
    Last edited by Daniil; Mar 18, 2013 at 1:22 PM. Reason: [CLOSED]
  2. #2
    Hi @ontiv,

    I think it works, just its effect invisible in your sample. Probably, because of the Align="Middle" setting.

    HBoxLayout logic transforms margins to absolute positions. So, "margin-top: 5px" becomes "top: 5px;".

    Please run this example. The two same images except the StyleSpec setting. And the Image with this setting is shifted down.

    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>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Height="50" Layout="HBoxLayout">
                <Items>
                    <ext:Image 
                        runat="server" 
                        ImageUrl="/resources/images/test.png" />
                    <ext:Image 
                        runat="server" 
                        ImageUrl="/resources/images/test.png" 
                        StyleSpec="margin-top: 5px;" />
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
    There is also the Margins property.

    Example
    <ext:Image 
        runat="server" 
        ImageUrl="/resources/images/test.png" 
        Margins="5 0 0 0" />
  3. #3
    Hi Daniil,

    thanks for reply! This helps me...

Similar Threads

  1. getRowsValues doesn't work
    By teamsar in forum 2.x Help
    Replies: 9
    Last Post: Jan 10, 2013, 2:05 AM
  2. Replies: 6
    Last Post: Mar 16, 2012, 7:03 PM
  3. Northwind example doesn't work in IE9
    By Const in forum 1.x Help
    Replies: 10
    Last Post: Dec 09, 2011, 3:04 AM
  4. tabpanel doesn't work in IE8
    By maryam in forum 1.x Help
    Replies: 3
    Last Post: Aug 18, 2010, 5:49 AM
  5. Keymap doesn't work
    By Kamal in forum 1.x Help
    Replies: 2
    Last Post: Aug 13, 2009, 10:49 AM

Posting Permissions