Remove grouping programmatically ?

4 posts, 0 answers
  1. Bibin
    Bibin avatar
    8 posts
    Member since:
    Nov 2012

    Posted 13 Dec 2012 Link to this post

    Is it possible to remove the grid grouping programmatically? 
  2. Marcin Butlak
    Marcin Butlak avatar
    26 posts
    Member since:
    Dec 2012

    Posted 14 Dec 2012 Link to this post

    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([]);
  3. Kendo UI is VS 2017 Ready
  4. Jason
    Jason avatar
    44 posts
    Member since:
    Apr 2013

    Posted 29 Oct 2013 Link to this post

    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.
  5. Jason
    Jason avatar
    44 posts
    Member since:
    Apr 2013

    Posted 29 Oct 2013 Link to this post

    I was doing something else wrong, so the following code does in fact WORK...

    ...
    var grid = $('#grid').data('kendoGrid');
    grid.dataSource.group([]);
    ...
Back to Top
Kendo UI is VS 2017 Ready