[CLOSED] DateTime - Impossible to Update

  1. #1

    [CLOSED] DateTime - Impossible to Update

    Hi,

    I've got some troubles on my application using Coolite.

    I'm building dynamic table using SQL description.

    Everything works very well before.
    Today, I upgrade Coolite Dll version in 8.2 : Now , when i'm choosing a other date, Nothing change (no red on corner)and this cell date returns the previous value


    For example, if i've got "30/10/2009", I take other one : "01/01/2010" when i left this cell, the date go to "30/10/2009".



    [...]
    
    RecordField RecordF = new Coolite.Ext.Web.RecordField(strColonneName.Caption, RecordFieldType.Date, "yyyy-MM-ddTHH:mm:ss");
    
    [...]
    ((Coolite.Ext.Web.JsonReader)this.Store1.Reader[0]).Fields.Add(RecordF);
    
    [...]
    //// ADD Column to columns collection
    _col = new Coolite.Ext.Web.Column();
    _col.ColumnID = dc.Caption;// "CLM_" + _n.ToString();
    _col.Header = fstrGetColumnHeader(dc.Caption, _ds_TableInformation);
    _col.DataIndex = dc.Caption;
    _col.Hidden = dc.ColumnName.Equals(strPrimaryKeyName);
    
    [...]
    
    DateField Df = new DateField();
    Df.ID = "DataField_" + _n.ToString();
    Df.AllowBlank = false;
    _col.Editor.Add(Df);
    
    
    [...]
    this.GridPanel1.AddColumn(_col);
    I've got something wrong?

    Thanks,
  2. #2

    RE: [CLOSED] DateTime - Impossible to Update

    Hi,

    I think you have to define Format for the DateField (also if you require multiple possible formats then use AltFormats)
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] {DateTime.Now},
                    new object[] {DateTime.Now},
                    new object[] {DateTime.Now}
                };
    
                this.Store1.DataBind();
            }
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="Date" Type="Date" DateFormat="yyyy-MM-ddTHH:mm:ss" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:GridPanel 
                ID="GridPanel1" 
                runat="server" 
                StoreID="Store1" 
                StripeRows="true"
                Title="Grid" 
                Width="600" 
                Height="350"
                AutoExpandColumn="Date">
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Date" Sortable="true" DataIndex="Date">
                            <Renderer Fn="Ext.util.Format.dateRenderer('d/m/Y')" />
                            <Editor>
                                <ext:DateField runat="server" AllowBlank="false" Format="dd/MM/yyyy" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>        
            </ext:GridPanel>          
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] DateTime - Impossible to Update

    Thanks for your reply.

    I try your idea : AltFormats = "d/m/Y" but it doesn't work. :-(

     //Df.AllowBlank = false;
    Df.AltFormats = "d/m/Y";
    I do some tests :

    1) i autorize blank value
    2) I go to my Date Cell and clear it. > Ok my cell is clear and i've got the red corner
    3) Select a date > Ok it works ! I can put the new date
    4) Select a other date > KO The cell returns to the date choose on point 3.




  4. #4

    RE: [CLOSED] DateTime - Impossible to Update

    Hi,

    Did you define base Format? Just date field using Format first to parse input. AltFormats is used if date parsing with Format is failed.


    Please note that Format and AltFormats have to complied .NET date format specifiers
    http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
  5. #5

    RE: [CLOSED] DateTime - Impossible to Update

    When i implement my RecordField, i input date format : "yyyy-MM-ddTHH:mm:ss"

    I've got :

      _col = new Coolite.Ext.Web.Column();
    
    _col.Renderer.Fn = "Ext.util.Format.dateRenderer('d/m/Y')";
    [...]
    
    
    DateField Df = new DateField(); 
    Df.AltFormats = "d/m/Y";
    Df.Format = "d/M/y";
    It's very strange : If i clear column date, i can choose a other one. But if, the field isn't clear, i can put another date.


  6. #6

    RE: [CLOSED] DateTime - Impossible to Update

    Hi,

    Ext.util.Format.dateRenderer('d/m/Y')
    It is javascript function therefore in this case you should use ExtJS (PHP) date format


    But Fortmat and AltFormats are server side therefore you should use .NET format. If you set
    Df.Format = "d/M/y";

    then it should the following date (example)
    5/5/09

    Do you expects such date?


    Df.AltFormats = "d/m/Y";
    This date is incorrect because 'm' - The minute, from 0 through 59.


    What your current culture?
  7. #7

    RE: [CLOSED] DateTime - Impossible to Update

    hi,

    My culture info is {fr-FR}


    Exact, I make a mistake
    I change my Format and AltFormats with "dd/MM/yyyy"


    But i've got the same trouble ! I can change my date :(



  8. #8

    RE: [CLOSED] DateTime - Impossible to Update

    Hi MERIAL,

    We have reproduced the problem and we're working on a fix. We should hopefully have a solution available very shortly.


    Thanks for reporting the defect.


    Geoffrey McGill
    Founder
  9. #9

    RE: [CLOSED] DateTime - Impossible to Update

    Hi,

    Fixed. Please update from SVN

Similar Threads

  1. [CLOSED] Impossible to show horizontal scroll in gridpanel
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jul 20, 2011, 11:31 AM
  2. [CLOSED] Save datetime in grid
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Dec 01, 2010, 11:10 AM
  3. [CLOSED] DateTime Column Formatting
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 29, 2010, 4:55 PM
  4. Datetime
    By Wtower in forum 1.x Help
    Replies: 1
    Last Post: Sep 05, 2009, 9:53 AM
  5. [CLOSED] datetime field
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 11, 2009, 1:59 PM

Posting Permissions