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

Help recreating transport URLs

1 Answer 36 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Brian Vallelunga
Top achievements
Rank 1
Brian Vallelunga asked on 22 Aug 2012, 06:20 PM
I have a grid with a data source that posts JSON to my server and returns JSON to populate the grid. What I need to do is add the capability to download the data as an Excel file. The creation of the Excel file is easy enough, but what I need help with is forming a proper URL, using a datasource's existing filtering and sorting options as query parameters. The reason for this is that file downloads via ajax posting are not allowed.

Obviously the framework does this internally when setting a data source transport's type to GET. Is there a way I can access the transport's read URL? My export URL will be identical, with a minor change I can make manually. If there is no way to get the full URL, is there a way to have the data source's filter and sort values be URL encoded by the framework?

If these aren't possible, might I suggest adding an "export" transport option to the data source object that we could configure for just this scenario?

Thanks

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 27 Aug 2012, 04:28 PM
Hello Brian,

I can suggest you to use the work-around used in this export to Excel code library which is related to the KendoWrappers for MVC. However the client side function which generated the URL in the toolbar link will do the work for you.

I hope this helps!

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Brian Vallelunga
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or