This is a migrated thread and some comments may be shown as answers.

Remove grouping programmatically ?

3 Answers 1532 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bibin
Top achievements
Rank 1
Bibin asked on 13 Dec 2012, 02:05 PM
Is it possible to remove the grid grouping programmatically? 

3 Answers, 1 is accepted

Sort by
0
Marcin Butlak
Top achievements
Rank 2
answered on 14 Dec 2012, 12:30 PM
Yes there is http://docs.kendoui.com/api/framework/datasource#group. For more detailed configuration option and method calls refer to the API Reference. But to make you long journey short:
var grid = $('#grid').data('kendoGrid');
grid.dataSource.group([]);
0
Jason
Top achievements
Rank 1
answered on 29 Oct 2013, 05:23 PM
I have several buttons that I have wired up to "Reset" a Kendo Grid... one of those buttons removes the grouping that might have been applied to this grid...  I have the button wired up with the following javascript

...
var grid = $('#grid').data('kendoGrid');
grid.dataSource.group([]);
...

But when this button is clicked it throws an error in the kendo.all.min.js file (line 15, column 25157) that says "Unable to get property 'replace' of undefined or null reference...

I have also tried these
grid.dataSource.group([{}]);
grid.dataSource.group([{field: ""}]);

Basically I just want to be able to programmatically remove the grouping that may have been applied to the grid.
0
Jason
Top achievements
Rank 1
answered on 29 Oct 2013, 07:15 PM
I was doing something else wrong, so the following code does in fact WORK...

...
var grid = $('#grid').data('kendoGrid');
grid.dataSource.group([]);
...
Tags
Grid
Asked by
Bibin
Top achievements
Rank 1
Answers by
Marcin Butlak
Top achievements
Rank 2
Jason
Top achievements
Rank 1
Share this question
or