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

Expose DataSource url

1 Answer 284 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Redsquare
Top achievements
Rank 1
Redsquare asked on 11 Feb 2012, 05:36 PM
I need to be able to get to the url that is called by the grid after filtering, sorting operations. It would be great if you would expose the url parser that is currently internal so i can use it to save history for browser back operations.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Feb 2012, 07:55 AM
Hello Steve,

The initial dataSource read URL is available via:

$("#GridID").data("kendoGrid").dataSource.transport.options.read.url

From that point on, the request URL is constructed internally by jQuery, so it would be difficult to provide that. What you can do is retrieve the options before each request (page number, sort order, etc) and store them somewhere to trigger an identical data request later with the dataSource's query() method.

The options retrieval should be done in the dataSource's parameterMap function like this:

var dataSource = new kendo.data.DataSource({
     transport: {
       read: "....url......",
       parameterMap: function(options) {
          // store options somewhere .......
          return options;
       }
     }
 });


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