-
4 Sep 2008 11:19 PM #1
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"
-
4 Sep 2008 11:23 PM #2
I'm a bit confused, can you rephrase your question?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
4 Sep 2008 11:25 PM #3
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 Sep 2008 11:29 PM #4
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
-
4 Sep 2008 11:31 PM #5
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!
-
4 Sep 2008 11:37 PM #6


Reply With Quote