Author Topic: Grouping with blank cells  (Read 1538 times)

luckduck

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Grouping with blank cells
« on: May 15, 2020, 09:54:03 am »
Hi Paramvir,

When grouping, I want to group only when the value of the grouping target cell is not blank.

For example, if the value of item4 is blank, I want to group to item3, and if the value of item4 is not blank, I want to group to item4.

Below is the link of the jsfiddle:
https://jsfiddle.net/bzsgftyk/

Thank you.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grouping with blank cells
« Reply #1 on: May 18, 2020, 08:01:47 am »
Grouping works with uniform level of grouping only.

However for aesthetics, parent title can be displayed when current grouping title is blank with help of groupModel.titleDefault.

Code: [Select]
    titleDefault: function( ui ){
    var G = this.Group(),
        label = ui.cellData || G.getParent( ui.rowData )[ui.dataIndx];     
        return label + " (" + G.getChildren( ui.rowData ).length + ")";
    },

https://jsfiddle.net/ojmksuap/