Author Topic: With grouping - columns cannot be rendered.  (Read 2815 times)

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
With grouping - columns cannot be rendered.
« on: July 25, 2016, 10:57:09 am »
In your demos 3.30 under "Row grouping" i.e. http://paramquery.com/pro/demos/group_rows
I just changed rendering for Customer Name to cause it to be in upper case with this ColModel declaration:
       { title: "Customer Name", width: 130, dataIndx: "ContactName",
               render: function (ui) {
                    var txt = ui.cellData;
                    return { text: txt.toUpperCase() }
               }
       },

This will cause this error to appear "Uncaught TypeError: Cannot read property 'toUpperCase' of undefined"
This is because ui.cellData is undefined

Also I noticed that out of all the columns in the grid - ui.rowData has only these 3 columns: freight, ShipCountry and ShippedDate. All the other columns are undefined.

I need render to display cells according to what the user needs and the user needs grouping.
Is there any work-around?

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: With grouping - columns cannot be rendered.
« Reply #1 on: July 25, 2016, 11:36:33 am »
My present workaround is to put a                 

summary: {type: "count"}

for all the columns that need to be rendered.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: With grouping - columns cannot be rendered.
« Reply #2 on: July 25, 2016, 11:54:21 am »
You need to correct your render callback:

Code: [Select]
var txt = ui.cellData == null? "": ui.cellData;

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: With grouping - columns cannot be rendered.
« Reply #3 on: July 25, 2016, 01:10:55 pm »
I have already put in the check for null. But there is data - however in the ui.cellData it is undefined and even the ui.rowData is defined for those with summary. All the other data is lost and I need a formula and also I need to convert date to dd/MMM/yyyyy format.