Author Topic: Issue grouping by column when you have customer rendered the cell  (Read 2853 times)

youngfitz

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
Issue grouping by column when you have customer rendered the cell
« on: September 27, 2018, 08:39:08 pm »
Hi,

When you apply rendering to a cell and then try to group by it, the arrow to expand or collapse is missing and the summary of the record count is missing.
I edited your cell render example ( https://paramquery.com/pro/demos/render_cells ) and made the company name the rendered cell. I removed the image and just returned the text.

Attached are screenshots to show the issue.

Thanks,
Gary

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Issue grouping by column when you have customer rendered the cell
« Reply #1 on: September 28, 2018, 09:44:36 pm »
That's not a bug, column render is a complete renderer of the cell means it renders the cell the way you write it.

You are overwriting the inbuilt renderers of the grid by implementing yours.

If you want to skip your renderer for the group titles and summary rows, then you can do so by checking pq_gtitle and pq_gsummary properties in the rowData and return nothing when true.

Code: [Select]
if ( ui.rowData.pq_gtitle || ui.rowData.pq_gsummary ){
   return;
}
else{
  return your custom renderer
}

« Last Edit: September 28, 2018, 09:47:40 pm by paramquery »

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: Issue grouping by column when you have customer rendered the cell
« Reply #2 on: February 02, 2021, 11:31:00 pm »
Hi, I know this is an old post, but I had a similar issue and did this to resolve it.  Posting it here to see if it was okay to do or if a new feature might come to allow grouping of rendered cells. What I did below is working as of the current version today.

Code: [Select]
function xmGridLookup(ui) {
if (xmGridLUV.hasOwnProperty(ui.dataIndx) && xmGridLUV[ui.dataIndx].hasOwnProperty(ui.cellData)) {
var prefix = "";
if ( ui.rowData.pq_gtitle || ui.rowData.pq_gsummary ){
prefix = '<span class="pq-group-icon glyphicon glyphicon-triangle-right"></span> ';
}
return prefix + xmGridLUV[ui.dataIndx][ui.cellData];
}
}