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

Grid Sorting,paging,filtering,expand child,collapse child,refresh handles via button click

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 30 Jul 2013, 09:10 AM
dear all,

            i've the kendo grid which i need to manually enable the grid properties like sorting,filtering,paging,grouping via button click to the grid

i.e it is like a toolbar for the grid to enable or disable the  sorting,filtering,paging,grouping,refresh when button click event occurs

this is my sample code to enable the properties

$("#grouping").click(function () {
         $("#grid").data("kendoGrid").groupable(true);
           });

           $("#removegrouping").click(function () {
              $("#grid").data("kendoGrid").groupable(false);
           });
 $("#sorting").click(function () {
               $("#grid").data("kendoGrid").sorting(true);
            });
but it shows the error 
may any one help for this thread 
thanks in advance

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 30 Jul 2013, 01:15 PM
Hello Santhosh,

Basically you cannot change the configuration options of the grid dynamically, what I mean is that you cannot change its sorting, paging or filtering options after the grid was created. 

Regarding the expand and collapse functionality, there are built-in methods expandRow() and collapseRow() that can be used to achieve such functionality. And of course there is a refresh() method that can be used to refresh the grid. Please follow this link to read more about the built-in Kendo UI Grid functionality:

http://docs.kendoui.com/api/web/grid

A workaround is to destroy the current grid when the button is clicked and then recreate it with the new settings, but this is an additional overhead that might slow down your application depending on the data loaded in the grid. I have prepared a sample with this implementation, that you can look into:

http://jsbin.com/omevih/1/
 

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or