1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    220
    Answers
    13
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default Answered: Grid Field dateFormat in Tpl

    Answered: Grid Field dateFormat in Tpl


    Hi.
    Im trying to give a grid field with type = date a format (date format) when used in a tpl like the followin code
    Code:
     columns: [{
                header:'Example Column', 
                xtype:'datecolumn', 
                dataIndex:'epaFch', 
                format:'l j \\d\\e M Y',
                width: 250
            },
            {   header:'What i want column', 
                xtype:'templatecolumn', 
                tpl:'{epaFch}<br>{anotherDataIndex}', 
                width: 250
            }
    ]
    The first column shows the date with the format i want and its working fine. (included this column just as a example)

    The second column is using a template where i reference the date field epaFch, in this case shows the default date.toString() text.

    How can i t specify the format to use to render epaFch in that tpl ?
    is this posible ? if not whats the best aproach ?
    1) use a function in renderer : function() that returns the string i want ?
    2) define another column in my Model (calculated) with the string i want so i can reference it in the tpl
    3) In the server side generate another column like epaFchString that has what i want to show ?

    sorry for my english.

  2. Code:
    {
        header: 'What i want column',
        width: 250,
        xtype: 'templatecolumn',
        tpl: Ext.create('Ext.XTemplate', '{epaFch:this.myDateRenderer}<br>{anotherDataIndex}', {
            myDateRenderer: Ext.util.Format.dateRenderer('l j \\d\\e M Y')
        })
    }

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,573
    Answers
    540
    Vote Rating
    310
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Code:
    {
        header: 'What i want column',
        width: 250,
        xtype: 'templatecolumn',
        tpl: Ext.create('Ext.XTemplate', '{epaFch:this.myDateRenderer}<br>{anotherDataIndex}', {
            myDateRenderer: Ext.util.Format.dateRenderer('l j \\d\\e M Y')
        })
    }

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    220
    Answers
    13
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    thank you

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi