[CLOSED] GroupHeaderTpl && date

  1. #1

    [CLOSED] GroupHeaderTpl && date

    Hello good.

    I'm trying to apply a date format to a group and can not.

    I have tried the following.

    
                XTemplate tpl = new XTemplate()
                {
                    ID = "XTemplate1"
                };
    
                tpl.Html = "<tpl if=\"groupField === 'DueDate'\">" +
                                "{columnName}: {[Ext.util.Format.date(values.rs[0].data.DueDate, 'Y/m/d')]}" +
                            "<tpl else>" +
                                "{columnName}: {name} ({[values.rows.length]} {[values.rows.length > 1 ? 'Tareas' : 'Tarea']})" +
                            "</tpl>";
    
                Grouping g = new Grouping();
                g.GroupHeaderTpl = tpl;
    
    
               //otherwise
    
                XTemplate tpl = new XTemplate()
                {
                    ID = "XTemplate1"
                };
    
                tpl.Html = "<tpl if=\"groupField === 'DueDate'\">" +
                                "{columnName}: {[Ext.util.Format.date(name, 'Y/m/d')]}" +
                            "<tpl else>" +
                                "{columnName}: {name} ({[values.rows.length]} {[values.rows.length > 1 ? 'Tareas' : 'Tarea']})" +
                            "</tpl>";
    
                Grouping g = new Grouping();
                g.GroupHeaderTpl = tpl;


    Thank you very much.
    Last edited by Daniil; Dec 04, 2014 at 9:54 AM. Reason: [CLOSED]
  2. #2

    I auto answer

    I auto answer

      tpl.Html = "<tpl if=\"groupField === 'DueDate'\">" +
                                "{columnName}: {[" + TasksGrid.SCOPE + ".renderDate(values.name)]} ({[values.rows.length]} {[values.rows.length > 1 ? \"Tareas\" : \"Tarea\"]})" +
                            "<tpl else>" +
                                "{columnName}: {name} ({[values.rows.length]} {[values.rows.length > 1 ? 'Tareas' : 'Tarea']})" +
                            "</tpl>";
    
       renderDate: function(name) {
            return Ext.util.Format.date(name, 'd-m-Y');
        },

Similar Threads

  1. Replies: 4
    Last Post: Jun 23, 2015, 10:32 AM
  2. [CLOSED] GroupCommand and GroupHeaderTpl
    By pgodwin in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 20, 2014, 7:10 AM
  3. [CLOSED] [#550] GroupHeaderTpl not working when gridpanel has GroupCommands
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 17
    Last Post: Sep 16, 2014, 5:58 PM
  4. Replies: 8
    Last Post: May 20, 2013, 4:01 AM
  5. Replies: 1
    Last Post: Apr 13, 2012, 1:52 PM

Posting Permissions