Author Topic: Hidden group by columns - upgrade from 5.6 to 7.1 issue  (Read 3436 times)

Choggo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 5
    • View Profile
Hidden group by columns - upgrade from 5.6 to 7.1 issue
« on: February 23, 2020, 06:02:58 am »
In 5.6 I had the grid running similar to the https://paramquery.com/pro/demos/group_rows_hidden sample. Group by columns hidden and displaying merged with the first visible column
The difference to my set up from the example, is that I had summaryInTitleRow set to 'all'

This worked fine, summary row created and summary data visible up top.

I've upgraded to 7.1 and the column is no longer merged in to the first column when summary is set to all.
This is reproduceable in the linked sample, where the grouping is no longer displayed.

What's the best approach to fix this?
I've also noticed that if set to summaryInTitleRow to collapsed, it works, but upon collapse the row gets removed and can no longer be collapsed.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #1 on: February 24, 2020, 09:59:13 am »
Please use groupModel.titleIndx option

if you want to display all titles in single column with non empty groupModel.summaryInTitleRow option.

Kindly check the updated example: https://paramquery.com/pro/demos/group_rows_hidden

Choggo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #2 on: February 25, 2020, 03:49:17 pm »
Perfect - Thanks solved it.

I also noticed another issue, where a JS error happens if you set the summary to not editable and don't define a summary function.
column.summary = {
            edit: false
        };


It seems the code tries to evaluate the summary against pq.aggregate[undefined] and throws the error below:

pqgrid.min.js:9 Uncaught TypeError: T[c] is not a function
    at n.cGroup._summaryT (pqgrid.min.js:9)
    at n.cGroup._summaryT (pqgrid.min.js:9)
    at n.cGroup._summaryT (pqgrid.min.js:9)
    at n.cGroup._summaryT (pqgrid.min.js:9)
    at n.cGroup.summaryT (pqgrid.min.js:9)
    at e.<computed>.<computed>.<anonymous> (pqgrid.min.js:15)
    at n (pqgrid.min.js:9)
    at e.<computed>.<computed>.e._trigger (pqgrid.min.js:9)
    at e.<computed>.<computed>.a._digestData (pqgrid.min.js:10)
    at e.<computed>.<computed>.n.updateRow (pqgrid.min.js:14)


It happens in the group demo you linked, if I edit one of the summaries to empty

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #3 on: February 25, 2020, 04:35:47 pm »
Thank you for noticing the issue, moving it to bug log..

Choggo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #4 on: March 02, 2020, 07:50:17 pm »
Hi Paramvir,

A follow up on this, as perhaps the changes introduced in 7.0 with regards to grouping, have changed the behavior I'm used to - or perhaps there is a way of still doing what I want.

I've rolled back to 6.1 as this one seems to have the same behavior I had in 5.6.

When grouping on 1 field and using titleInFirstCol, I would get the grouping expand/collapse buttons in the first column, and where not in a group, I would be able to edit the values of the first column.

It seems as this is no longed possible, as when I enable the titleIndx column for the group, I can no longed edit the first column's values. Should I use the titleIndx of the column I want to be editable?



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #5 on: March 02, 2020, 09:05:17 pm »
Quote
when I enable the titleIndx column for the group, I can no longer edit the first column's values.

titleIndx has nothing to do with editability of first column.

Can you please mention the steps to reproduce the issue.

Choggo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Hidden group by columns - upgrade from 5.6 to 7.1 issue
« Reply #6 on: March 03, 2020, 11:15:44 pm »
All snippets to be applied to https://paramquery.com/pro/demos/group_rows_hidden
I've mode the dataModel lines to before the grouping lines I've pasted below.

If I do it like this - I don't get to see the roll up option
I removed the titleIndx and tried to use what works in pre 7.x versions

summaryInTitleRow: 'all',
         first two columns are text and should not have summary
titleInFirstCol:true,
         Since there's no summary for rows 1 and 2, I should be able to edit column one, where not groupped

Code: [Select]
var colM = [
           // { dataIndx: 'grp', title: 'Group'},
            { title: "ShipCountry", width: 120, dataIndx: "ShipCountry",
                filter: {
                    condition: 'range'
                }
            },
            { title: "Customer Name", width: 130, dataIndx: "ContactName" },
            { title: "Freight", width: 120, format: '$##,###.00',
                summary: {
                    type: "sum"
                },
                dataType: "float", dataIndx: "Freight"
            },
            { title: "Shipping Via", width: 130, dataIndx: "ShipVia" },
    { title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date" },
            { title: "Shipping Address", width: 220, dataIndx: "ShipAddress" },
            { title: "Shipping City", width: 130, dataIndx: "ShipCity" }
];
     
        var groupModel = {
            on: true,
            headerMenu: false,
            indent: 20,
            dataIndx: ['ShipCountry'],
            summaryInTitleRow: 'all',
            //titleIndx: 'grp',
titleInFirstCol:true,
            showSummary: [true], //to display summary at end of every group.
            collapsed: [false]
        };

titleIndx and first group column used
Result is a very empty first column, with the expand collapse, non group data starts showing as of column 2

Code: [Select]
var colM = [
            { dataIndx: 'grp', title: 'Group'},
            { title: "ShipCountry", width: 120, dataIndx: "ShipCountry",
                filter: {
                    condition: 'range'
                }
            },
            { title: "Customer Name", width: 130, dataIndx: "ContactName" },
            { title: "Freight", width: 120, format: '$##,###.00',
                summary: {
                    type: "sum"
                },
                dataType: "float", dataIndx: "Freight"
            },
            { title: "Shipping Via", width: 130, dataIndx: "ShipVia" },
    { title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date" },
            { title: "Shipping Address", width: 220, dataIndx: "ShipAddress" },
            { title: "Shipping City", width: 130, dataIndx: "ShipCity" }
];
     
        var groupModel = {
            on: true,
            headerMenu: false,
            indent: 20,
            dataIndx: ['ShipCountry'],
            summaryInTitleRow: 'all',
            titleIndx: 'grp',
//titleInFirstCol:true,
            showSummary: [true], //to display summary at end of every group.
            collapsed: [false]
        };


titleInFirstCol:true introduced. Group column displays blank and expand collapse option available
Code: [Select]
var colM = [
            { dataIndx: 'grp', title: 'Group'},
            { title: "ShipCountry", width: 120, dataIndx: "ShipCountry",
                filter: {
                    condition: 'range'
                }
            },
            { title: "Customer Name", width: 130, dataIndx: "ContactName" },
            { title: "Freight", width: 120, format: '$##,###.00',
                summary: {
                    type: "sum"
                },
                dataType: "float", dataIndx: "Freight"
            },
            { title: "Shipping Via", width: 130, dataIndx: "ShipVia" },
    { title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date" },
            { title: "Shipping Address", width: 220, dataIndx: "ShipAddress" },
            { title: "Shipping City", width: 130, dataIndx: "ShipCity" }
];
     
        var groupModel = {
            on: true,
            headerMenu: false,
            indent: 20,
            dataIndx: ['ShipCountry'],
            summaryInTitleRow: 'all',
            titleIndx: 'grp',
titleInFirstCol:true,
            showSummary: [true], //to display summary at end of every group.
            collapsed: [false]
        };


End goal, a picture attached, to better show the objective :)