Grouping column linked to a button click

Hello 
We need to display in the grid component different column grouping based on button click .

Thanks in advance,
Andrea


1 Reply

VB Vinitha Balasubramanian Syncfusion Team April 13, 2022 02:22 PM UTC

Hi Andrea C,


Greetings from Syncfusion support.


Query : Grouping the column using the button click


Based on your query, we have achieved the group action on the Grid column(“Country“) when external button click action using the groupColumn method.


Please refer the below code example and sample for more information.


[index.js]

document.getElementById('group').addEventListener('click'function () {

  grid.groupColumn('Country');     // group column from grid instance

});


Sample link: https://stackblitz.com/edit/t54z3h?file=index.js


Documentation: https://ej2.syncfusion.com/javascript/demos/#/bootstrap5/grid/grouping.html


Please get back to us, if you need further assistance.


Regards,

Vinitha Balasubramanian.


Loader.
Up arrow icon