Jump to content

UniDBGrid gruoping title


codeb

Recommended Posts

Hi!

 

Is there solution to add custom title for Grouping title? I made UniDBGrid with grouping by date and there I get  like grouping title :

 

Date: 6/8/2015

 

I need to put day name in grouping title like

 

Date: Monday, 6/8/2015

 

Is there some solution?

 

Thanks!

 

 

Link to comment
Share on other sites

Hi,

 

You can use groupHeaderTpl

 

Try to analyze this example:

 

1. Open: "C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\GridGrouping\grp.dproj"

 

2. Change grouping FieldName:

post-906-0-67360300-1434403430_thumb.png

 

3. UniDBGrid1 -> ClientEvents -> UniEvents -> add function beforeInit

function beforeInit(sender, config)
{   
  var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
        groupHeaderTpl: 'Date: {[Ext.util.Format.date(Ext.Date.parse(values.name, "d.m.Y G:i:s"), "l, d/m/Y")]}',
        hideGroupedHeader: true
    });
  config.features = [groupingFeature]
}

post-906-0-98102900-1434403487_thumb.png

 

4. Result:

post-906-0-36820600-1434403626_thumb.png

 

Note: you may have a different date format

 

Best regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...