[CLOSED] ListViewColumn with wide XTemplate

  1. #1

    [CLOSED] ListViewColumn with wide XTemplate

    I have:

                    <ext:ListView ID="CommentsListView" runat="server" ColumnSort="false" Selectable="true" Flex="1">
    (...)
                    <Columns>
                        <ext:ListViewColumn Header="Header">
                        <XTemplate ID="Template1" runat="server">
                            <Html>
                                <div>
                                <p><b>{userFullNameDisplay}, {TransDateTZ:date("d-m-Y H:i:s")} </b></p>
                                <p>{Notes:htmlDecode}</p>
                                </div>
                            </Html>
                        </XTemplate>
                        </ext:ListViewColumn>
                    </Columns>
    My problem is that (probably because Notes is html) text doesn't wrap, instead draw in one line.
    Can you help me to change this ?
    Last edited by Daniil; Jun 08, 2011 at 11:16 AM. Reason: [CLOSED]
  2. #2
    Hi,

    This css rule
    white-space: normal;
    should help.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.ListView1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test test test test test test test" },
                    new object[] { "test test test test test test test" }
                };
                store.DataBind();
            }
        }
    </script>
    
    <!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>
        <style type="text/css">
            .my-listview .x-list-body dt {
                white-space: normal;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:ListView 
            ID="ListView1" 
            runat="server" 
            AutoHeight="true" 
            Width="100" 
            Cls="my-listview">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="test" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <Columns>
                <ext:ListViewColumn Header="Test" DataIndex="test">
                    <XTemplate runat="server">
                        <Html>
                            <div>
                                {test:htmlDecode}
                            </div>
                        </Html>
                    </XTemplate>
                </ext:ListViewColumn>
            </Columns>
        </ext:ListView>
        </form>
    </body>
    </html>
  3. #3
    thanks this is it! :)
  4. #4
    damn. It doesn't work in IE ?
  5. #5
    This is how I see it with IE9 (I'm not sure about compatibility mode)

    Click image for larger version. 

Name:	Przechwytywanie.PNG 
Views:	66 
Size:	6.9 KB 
ID:	2835


    Click image for larger version. 

Name:	ie.png 
Views:	66 
Size:	9.1 KB 
ID:	2834

    while it works fine with Chrome and FFx
  6. #6
    Compatibility Mode should be switched off, it's not supported.

    My example appears to be working fine under IE9.

    Can you change my example to reproduce the problem? I guess you should just change this thing:
    new object[] { "test test test test test test test" }

Similar Threads

  1. Replies: 0
    Last Post: Aug 01, 2012, 10:43 PM
  2. Replies: 4
    Last Post: Apr 15, 2011, 3:53 PM
  3. [CLOSED] [1.0] DirectEvent TimeOut = Can it be defaulted site wide?
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2010, 3:49 PM
  4. Setting HttpProxy Timeout value Applicaiton-Wide
    By johnharp in forum 1.x Help
    Replies: 1
    Last Post: Nov 25, 2009, 12:22 PM
  5. [CLOSED] XTemplate Update
    By Immobilmente in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 05, 2009, 6:42 AM

Posting Permissions