[CLOSED] DataView in IE

  1. #1

    [CLOSED] DataView in IE

    Hi,

    When I run my DataView, I all goes okay, but when I run in IE 8, the font color is missing :S.

    If you need me to make changes to the code to make it easier to run, please, let me know. But I can only do It latter at work, where I have VS 2008.

    Thanks

    <%@ Page Title="" Language="C#" MasterPageFile="~/View/Shared/Site.master" AutoEventWireup="true"
        CodeBehind="Default.aspx.cs" Inherits="Site.Web.View.Default" %>
    
    <asp:Content ContentPlaceHolderID="head" runat="server">
        <link href="../Style/Home.css" rel="stylesheet" type="text/css" />
    </asp:Content>
    <asp:Content ContentPlaceHolderID="center" runat="server">
        <ext:DataView ID="ImageView" runat="server" AutoHeight="true" Selectable="false" ItemSelector="none" >
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Reader>
                        <ext:JsonReader>
                            <Fields>
                                <ext:RecordField Name="Titulo" />
                                <ext:RecordField Name="Data"/>
                                <ext:RecordField Name="Descricao" />
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
            </Store>
            <Template runat="server">
                <Html>
                <tpl for=".">
                        <h2 style="color:red">{Titulo}</h2>
                </tpl>
                </Html>
            </Template>
        </ext:DataView>
    </asp:Content>
    Last edited by Daniil; Feb 11, 2011 at 3:36 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I was unable to reproduce the problem using the code below. Color is applied under IE8.

    What is the content of Home.css?

    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.DataView1.GetStore();
                store.DataSource = new object[]
                {
                    new object[] { "test1" },
                    new object[] { "test2" },
                    new object[] { "test3" }
                };
                store.DataBind();
            }
        }
     
        protected void UpdateDataView(object sender, DirectEventArgs e)
        {
            Store store = this.DataView1.GetStore();
            store.DataSource = new object[]
                {
                    new object[] { "new test1" },
                    new object[] { "new test2" },
                    new object[] { "new test3" }
                };
            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-dataview .x-view-selected {
                background-color: Gray;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:DataView
            ID="DataView1"
            runat="server"
            AutoHeight="true"
            Cls="my-dataview"
            MultiSelect="true"
            ItemSelector="h2">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="test" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <Template runat="server">
                <Html>
                    <tpl for=".">
                        <h2 style="color:red">{test}</h2>
                    </tpl>
                </Html>
            </Template>
        </ext:DataView>
        <ext:Button runat="server" Text="Update">
            <DirectEvents>
                <Click OnEvent="UpdateDataView" />
            </DirectEvents>
        </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    Thanks, I will give it a go when I get to work latter today
  4. #4
    ...................
  5. #5
    Hi, i found out what is going on.

    I have the property "selectable = false", that is causing everything to go gray.

    I looked up at extjs' docs for information on this property, but couldn't. Could you, please, explain me the purpose of it?

    Thanks
  6. #6
    Hi,

    We added .selectable property for Component class (DataVIew is sub-class of Component).

    The following method should clarify .selectable's meaning.

    Example
    setSelectable : function (selectable) {
        if (selectable === false) {
            this.setDisabled(true).el.removeClass("x-item-disabled").applyStyles("color:black;");
        } else if (selectable === true) {
            this.setDisabled(false);
        }
        
        this.selectable = false;
        
        return this;
    }
    Well, it's not option to use this property for DataView.

    Could you clarify what are you trying to achieve?
  7. #7
    I was trying to make it unselectable (like select a line from a grid), but it uses this behavior by default.

    So, in the end, I actually didnt need that property.

    Thanks. Please, mark as solved.

Similar Threads

  1. [CLOSED] DataView to DataView Drag and Drop
    By paulc in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 10, 2012, 8:19 PM
  2. [CLOSED] [1.0] DataView MultiSelect
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 17, 2010, 3:47 PM
  3. [CLOSED] DataView and Grouping?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 07, 2009, 3:43 PM
  4. [CLOSED] Paging dataview
    By Rod in forum 1.x Help
    Replies: 4
    Last Post: Nov 06, 2008, 4:13 AM
  5. [CLOSED] DataView overwrite
    By Lex in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 09, 2008, 6:08 AM

Posting Permissions