ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: WTC_User on October 02, 2017, 09:01:55 pm

Title: Grouping formatted dates with paramquery pro 3.3.5
Post by: WTC_User on October 02, 2017, 09:01:55 pm
Referring to this example: https://paramquery.com/pro/demos/group_rows

I have to group rows by shipping date columns, but the dates must be formatted...so, add in the date column the italian format (it's an example).

The shipping date column going to be like this:

    { title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date", format: "dd/mm/yy" }

When I group by this column I will see the group date isn't formatted like rows...It's a bug or there is a configuration that resolve this problem?
Title: Re: Grouping formatted dates with paramquery pro 3.3.5
Post by: paramvir on October 02, 2017, 10:36:22 pm
That seems like an issue.

It can be resolved by using a titleRenderer in groupModel.

Code: [Select]
function titleRenderer(ui){
return ui.formatVal + " ("+ui.rowData.pq_items+")";
}

and in groupModel.title use

Code: [Select]
        var groupModel = {
            on: true,
            title: [
titleRenderer,
                titleRenderer
            ],
            .... other properties..
        };
Title: Re: Grouping formatted dates with paramquery pro 3.3.5
Post by: WTC_User on October 03, 2017, 12:26:38 pm
Thank U!
This will be the corrective way (but not correct)...So I've used titleDefault option because the date group can be in any position..