We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all,
    I have a grid where I display some events... I want them group by descending date of event...
    Events are objects stored in custom table, date of event is a field of type 'DATE' (dbtype='date' and phptype =" date" too)...
    If i try to sort my grid on desc date, without grouping it works fine, the events are displayed in desc order (the more recent first), as soon as I add the groupBy property on my grid, the grouping works fine but only in ASC order, I can't arrive to have both grouping and sorting working together...
    Any clue would be great

    //...
     Ext.applyIf(config,{
            id: 'grid-events-all',
            url: myCmp.config.connectorUrl,
            baseParams: {
                action: 'mgr/events/getlist'
            },
            fields: ['id','cat_event','createdby','parent','start_date'],
            width: '98%',
            paging: true,
            remoteSort: true, 
            grouping: true, // removing the next 3 lines and sorting works fine (remoteSort DESC based on start_date), try to add grouping, groupBy, and no more  DESC order 
            groupBy: 'start_date',
            sortBy: ''start_date',
            singleText: 'event',
            pluralText:'events',
    

    Cheers