Declined
Last Updated: 25 May 2021 10:08 by ADMIN
faris
Created on: 25 Jun 2014 05:19
Category: UI for ASP.NET MVC
Type: Feature Request
6
allow kendo mvc to use .beforesend
4 comments
ADMIN
Viktor Tachev
Posted on: 25 May 2021 10:08

Hello,

We are declining this request due to lack of interest and activity. 

That said, additional information can be passed to the Controller by utilizing the Data() method:

https://docs.telerik.com/aspnet-mvc/html-helpers/data-management/grid/faq#how-can-i-send-values-to-my-action-method-when-binding-the-grid

 

Regards,
Viktor Tachev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Telerik Admin
Posted on: 30 Jun 2014 13:01
Thanks for clarifying.

Note that you can specify the read transport option as a function, as explained in the API documentation (http://docs.telerik.com/kendo-ui/api/framework/datasource#configuration-transport.read). 

Thus you can specify $.ajax call and set headers via the headers attribute, or intercept the beforeSend event as depicted here:
http://stackoverflow.com/questions/7686827/how-can-i-add-a-custom-http-header-to-ajax-request-with-js-or-jquery

I'll forward your feedback for exposing this via the MVC data source wrapper to our devteam.
faris
Posted on: 25 Jun 2014 16:02
Nope.. Now i need to set manually in javascript

        grid.dataSource.transport.options.read.beforeSend = function (req) {
            req.setRequestHeader('Authorization', 'Basic abc:123');.

I hope kendo mvc add 1 more helper in grid helper that can call beforesend
ADMIN
Telerik Admin
Posted on: 25 Jun 2014 08:31
I assume you are talking about the jQuery ajax beforesend event here, is that correct?
http://api.jquery.com/Ajax_Events/

And if so, can you clarify what prevents you from intercepting this event when making $.ajax calls?