Show/Hide the grouping bar

Hi team,

Is there a property for the ejs-grid that I can hide/show the grouping bar on top of the grid? for example if users wants to group columns they click on button to hide/show the grouping bar area on top.

Cheers

Ali 

5 Replies

MS Madhu Sudhanan P Syncfusion Team October 19, 2018 05:05 AM UTC

Hi Ali, 

Thanks for contacting Syncfusion support. 

Please refer to the below help to hide group drop area using groupSettings.showDropArea property 


Regards, 
Madhu Sudhanan P 



AJ AJ November 9, 2018 12:43 AM UTC

Hi Madhu,

Thanks for the reply, let share some screenshots to explain what I'm trying to achive here with the grouping row on the grid. 

What my goals are :

  • Always hide the groupping bar once the user goes to the page with the grid (default)
  • User can show the groupping bar either by clicking a hide/show button or hovering mouse over the top of grid and it will show the groupping bar 
Our dev team would like to achive these goals and the groupSettings.showDropArea didnt show how I can use the proprty to hide/show the grouping bar 
 
Cheers

Ali

Attachment: groupping_50c961ce.zip


MF Mohammed Farook J Syncfusion Team November 9, 2018 09:01 AM UTC

Hi Ali, 
 
We have prepared the sample with your requirement. So please refer the below sample for further assistance, 
 
 
Code snippet:                                                                                                                                                                                                                 
 
Html: 
 
<input type="button" id="show" (click)="show()" value="Show" /> 
<input type="button" id="hide" (click)="hide()" value="Hide" /> 
<ejs-grid #grid [allowGrouping]="true" [groupSettings]="groupOptions"> 
 
    ... 
     
</ejs-grid> 
 
---------------------------------------------------------------------------------------------------------------------------------------- 
 
Typescript: 
 
export class GroupComponent implements OnInit { 
    @ViewChild('grid') 
    public grid: GridComponent; 
    ngOnInit(): void { 
        this.groupOptions = { showDropArea: false };  // to hide the drop area at initial rendering 
    } 
 
    hide(){ 
      (this.grid.groupModule as any).groupSettings.showDropArea = false; 
      this.grid.refresh(); 
    } 
 
    show(){ 
      (this.grid.groupModule as any).groupSettings.showDropArea = true; 
      this.grid.refresh(); 
    } 
} 
 
 
 
If you want to hide  group drop area while grouping , we suggest to use ‘actionComplete’ event . Please find the code example 
 
[app.component.html] 
 
  <ejs-grid #grid [dataSource]='data'  (actionComplete)= 'actionComplete($event)' allowPaging='true' allowSorting="true" [allowGrouping]="true" [groupSettings]="groupOptions"> 
        . . .  
        </e-columns> 
    </ejs-grid> 
 
 
 
[app.component.ts] 
 
 . . .  
actionComplete(args) { 
    if (args.requestType === 'grouping' || args.requestType === 'ungrouping') { 
      this.grid.groupSettings.showDropArea = this.grid.groupSettings.columns.length == 0 ? true : false; 
    } 
 
  } 
 
 
 
 
 
If you want to manually ungroup column by using ungroupColumn method. Please find the ug reference. 
 
 
 
 
 
Regards, 
J Mohamemd Farook 



AJ AJ November 11, 2018 07:30 PM UTC

Hi J,

Thank you for the provided examples, really appreciate it.

Cheers

Ali




VA Venkatesh Ayothi Raman Syncfusion Team November 12, 2018 04:06 AM UTC

Hi Ali, 

Thanks for the feedback. 

We are very happy to hear that your requirement is achieved. 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon