1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default Date renderer doesnt render column when sorted

    Date renderer doesnt render column when sorted


    hey folks got a date renderer formating a date sent in format : 'Y-m-d H:i' into the same format as without the renderer the date is formatted to :
    'sat aug 30 12:00:00 UTC +0200 2008'


    The renderer works fine even during sorting of rows however when the date row is sorted the date is not formated by the render by is show in the second format
    'sat aug 30 12:00:00 UTC +0200 2008'

    any ideas??

    Code:
    //declaration of column in store
    {name: 'ts', type: 'date', mapping: 'ts'}   
    
    //Part of column model
          {
            header: 'Created',
            dataIndex: 'ts',
            width: 130,
            renderer:Ext.util.Format.dateRenderer('Y-m-d H:i'),
            hidden: false           
          }
    
    //value returned found in firebug
    "ts":"2008\/09\/02 15:11"

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,850
    Vote Rating
    610
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I'm a bit confused, can you rephrase your question?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    Oh and the formatting of the date is done in PHP like this

    Code:
    for($i=0;$i<count($werks);$i++){
            $ts=$werks[$i]['ts'];
                
            $year=substr($ts,0,4);
            $month=substr($ts,4,2);
            $day=substr($ts,6,2);
            $hour=substr($ts,8,2);
            $mins=substr($ts,10,2);
            $secs=substr($ts,12,2);
            
            $dateString=$year.'/'.$month.'/'.$day.' '.$hour.':'.$mins;
        
            
            $werks[$i]['ts']=$dateString;
            
        }

  4. #4
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    well i know this will sound weird but instead of using timestamp as the datatype in the DB i being forced to use VARCHAR. this means im splitting up the TS which has been saved as a string in PHP. PHP recieves 20080303122806 which i break up.

    When i send this to ext without a daterender on the column displaying the date i get 'sat aug 30... etc'

    adding the date render shown in the column model formats the date correctly until that column is sorted then the date produced when not using the render is displayed

    Hope thats clearer

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,850
    Vote Rating
    610
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    That's pretty odd. Can you put a test case online at all?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
    Padster is on a distinguished road

      0  

    Default


    Sorry i cant all offline

    row.JPG

    row2.JPG

Thread Participants: 1