1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    1
    Vote Rating
    0
    mharkus is on a distinguished road

      0  

    Default Render a Date field

    Render a Date field


    Hi all,

    I have an xml which returns a date in format 2007-06-04 14:47:00.0 and I tried using:

    Code:
    renderer:  Ext.util.Format.dateRenderer('Y-m-d H:i:s')
    but the grid shows NaN. I hope somebody can help me.

    Thanks,
    Marc

  2. #2
    Ext User
    Join Date
    May 2007
    Posts
    3
    Vote Rating
    0
    simonspitz is on a distinguished road

      0  

    Default Here is a possible solution

    Here is a possible solution


    I had the same going on with Json Data and I came up with that little gizmo:

    PHP Code:
    function renderDate(value){
        var 
    dt = new Date();
        
    dt =  Date.parseDate(value"Y-m-d h:i:s");
        return 
    dt.format('d.m.Y H:i:s');
    }

    var 
    cm = new Ext.grid.ColumnModel(
      [
        {
    header'Date'sortabletruedataIndex'somedate'rendererrenderDate},
        .....
      ]
    ); 
    ... or the short form:

    PHP Code:
    function renderDate(value){
        return 
    Date.parseDate(value,"Y-m-d h:i:s").format('d.m.Y H:i:s');

    cheers

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Bandung, West Java, Indonesia
    Posts
    15
    Vote Rating
    0
    novaku is on a distinguished road

      0  

    Default thanks

    thanks


    excelent simonspitz, that's what i looking for all night...
    at last i found it.....

    mmmhh... wonder what could i give to you to bring back the favor
    but any way thanks mate..

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar