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

How to get current query from the grid

3 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 24 Oct 2013, 08:41 AM
Hello
I would like to add custom action that is fired outside of grid, but with grid current result set (without paging). So I would like to pass to my action grid related query string like sort, filter, group. Is it possible to obtain current query params in the same way as when using grid with server sorting, paging filtering and grouping?

I couldn't find any method on data source or grid to get grid query string.

Regards
Marcin

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 24 Oct 2013, 11:42 AM
Hello Marcin,

You can use the respective sort(), group() and filter() methods of the DataSource, so you can obtain the current configuration of the Kendo UI Grid. 

Please check the following API reference:

http://docs.kendoui.com/api/framework/datasource#methods
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Marcin
Top achievements
Rank 1
Veteran
answered on 24 Oct 2013, 12:00 PM
Hello,
I know, but how to get these values formatted in the same way like for query string instead of object: eg: get filter as following string:
filter=Postcode~startswith~'p'

Regards
Marcin
0
Accepted
Kiril Nikolov
Telerik team
answered on 28 Oct 2013, 07:42 AM
Hello Marcin,

A similar approach is used in one of our code-library project. Please check the following link:

http://www.kendoui.com/code-library/mvc/grid/export-grid-to-pdf.aspx

The functionality that you are looking for should be under views/home/index.cshtml
 
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
Marcin
Top achievements
Rank 1
Veteran
Answers by
Kiril Nikolov
Telerik team
Marcin
Top achievements
Rank 1
Veteran
Share this question
or