[CLOSED] IE8 javascript error

  1. #1

    [CLOSED] IE8 javascript error

    Hi

    In FF and Chrome ok but in I IE 8 I got this js error:

    Message: 'Date.dayNames[...]' is null or not an object
    Line: 80
    Char: 3
    Code: 0
    URI: http://localhost:1456/Kassa/extjs/lo...xt.axd?v=17017
    Date.getShortDayName = function(day) {
      return Date.dayNames[day].substring(0, 3);        this looks like line 80 to me
    };
    the debugger says:

    day is NaN ..
    Last edited by Daniil; Sep 21, 2010 at 9:21 AM. Reason: Please use [code] tags. [CLOSED]
  2. #2
    Hi,

    Please provide test sample which reproduces the issue
  3. #3
    I narrowed it down to the Date columns. The red one is causing the grid not to render.

    It looks like IE has a problem with ddd formating.

    When using dd then I get NaNNaN. It looks like it does not know d.

    Also as far as I can tell, the n and M also causes NaN's ..

    there are no problems with ff or chrome

    Hope this helps!

    <Columns>
                            <ext:Column Hidden="true" Hideable="false" ColumnID="TimeSlotId" DataIndex="TimeSlotId" Header="TimeSlotId" Width="140" Groupable="true" />
                            <ext:Column Hidden="true" Hideable="false" DataIndex="Id" Header="Id" />
                            <ext:DateColumn DataIndex="DatumOpvoering" Header="Dag" Format="ddd" />
                            <ext:DateColumn DataIndex="DatumOpvoering" Header="Datum" Format="d-MM" Align="Right" />
                            <ext:DateColumn DataIndex="TijdStart" Header="Start" Format="h:nn" Align="Right" />
                            <ext:ImageCommandColumn Width="200" Header="Titel" ColumnID="Titel" DataIndex="Titel">
                                <Commands>
                                    <ext:ImageCommand Icon="Add" CommandName="InsertEdit" Text=""/>
                                </Commands>
                                <PrepareCommand Fn="prepareTitle" />
                            </ext:ImageCommandColumn>
                            <ext:Column DataIndex="LengthPreShow" Header="Voor" Align="Right" />
                            <ext:Column DataIndex="Pauze" Header="Pauze" Align="Right" />
                            <ext:Column DataIndex="LengthAfterShow" Header="Na" Align="Right" />
                            <ext:DateColumn DataIndex="TijdEind" Header="Eind" Format="h:nn" Align="Right" />
                        </Columns>
    Last edited by geoffrey.mcgill; Sep 17, 2010 at 5:56 PM. Reason: please use [CODE] tags
  4. #4
    Hi,

    I cannot reproduce it, please provide full test sample
    Here is my test case
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            var store = this.GridPanel1.GetStore();
    
            store.DataSource = new object[]
                {
                    new object[] { DateTime.Now }                
                };
            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></title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" Locale="nl" />
            
            <ext:GridPanel
                ID="GridPanel1"
                runat="server" 
                Title="Array Grid" 
                Width="600" 
                Height="290">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="DateField" Type="Date" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:DateColumn DataIndex="DateField" Header="Dag" Format="ddd" />
                        <ext:DateColumn DataIndex="DateField" Header="Datum" Format="d-MM" Align="Right" />
                        <ext:DateColumn DataIndex="DateField" Header="Start" Format="h:nn" Align="Right" />
                        <ext:DateColumn DataIndex="DateField" Header="Eind" Format="h:nn" Align="Right" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5
    Thanks for the reply. I'm on the road right now. It will be monday when I'm able to investigate further.
  6. #6
    well I managed to get back to my laptop :) its a hard live without it.

    Anyway, your example just worked on my machine and that did me wonder why so I rendered your date value as a text column and compared it to mine. It was different ..

    you: Fri Sep 17 17:29:30 UTC+0200
    I: 2010-09-16T21:15:00
    The difference was caused by this definition in the datastore. The bold part made the difference. It was missing in my code.

    <ext:RecordField Name="DateField" Type="Date" />
    The problem is solved but the question still remains but is more specific now: in IE8 the auto conversion in the store or reader went wrong. Why? This is probably caused by the many differences between the browsers.
    Last edited by geoffrey.mcgill; Sep 17, 2010 at 5:57 PM. Reason: please use [CODE] tags
  7. #7
    Hi,

    There is no autoconversion in the store. You have to set Type="Date" for the field if you want to use DateColumn (and for correct sorting, filtering). It is required

Similar Threads

  1. [CLOSED] Javascript Error
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 18, 2012, 8:54 PM
  2. [CLOSED] [1.0] Javascript Error in IE8
    By Ben in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 21, 2010, 4:10 PM
  3. [CLOSED] Javascript Error?
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 15, 2009, 12:43 PM
  4. [CLOSED] javascript error
    By alexp in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 12, 2009, 10:59 AM
  5. [CLOSED] SVN JavaScript error
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 11, 2008, 6:53 PM

Tags for this Thread

Posting Permissions