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

Typescript: beforeSend missing in kendo.all.d.ts

4 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Enrico
Top achievements
Rank 1
Enrico asked on 21 Sep 2015, 08:29 PM

Hi,

after upgrading to typescript 1.6 I've got a compilation error in a piece of code that actually does work. I checked the definition file and I could not find any beforeSend at all! I'm using Kendo UI v2014.3.1411.

var dataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: 'myApiUrl',
                                beforeSend: function (xhr) {
                                    xhr.setRequestHeader('myAuthenticationHeader', 'myToken');
                                }
                            }
                        }
                    });

4 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 24 Sep 2015, 07:22 AM
Hi,

Please, install up-to-date definitions. An easy way to obtain them is by installing the ‚Äčkendo-ui.TypeScript.DefinitelyTyped NuGet package.

The code will compile, but you won't get full IntelliSense for the members accepted by $.ajax, just the "native" ones provided by Kendo UI.

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 24 Sep 2015, 07:38 AM

Hi,

sorry but it does not, got the same error. beforeSend is still missing in the type definitions.

Enrico

0
Accepted
T. Tsonev
Telerik team
answered on 25 Sep 2015, 03:51 PM
Hello,

Okay, I think I found the reason for this change in 1.6 release notes - Stricter object literal assignment checks.
What we need to do is to inherit from the JQueryAjaxSettings interface:
interface DataSourceTransportDestroy extends JQueryAjaxSettings {
    ...
}

We'll try to apply this fix as soon as possible. I've updated our Telerik points as a token of gratitude for your involvement.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrico
Top achievements
Rank 1
answered on 29 Sep 2015, 02:22 PM

Hi,

I've applied the suggested "extends JQueryAjaxSettings" to DataSourceTransportCreate, DataSourceTransportDestroy, DataSourceTransportRead, DataSourceTransportUpdate interfaces and now it compiles.

 

Thanks for the points and also for providing a valid solution :)

BR,

Enrico

Tags
General Discussions
Asked by
Enrico
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Enrico
Top achievements
Rank 1
Share this question
or