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

TypeScript: Argument of type 'JQuery' is not assignable to parameter of type 'HTMLElement'

3 Answers 518 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
Xavier
Top achievements
Rank 1
Xavier asked on 14 May 2015, 07:11 PM

Hello,

I have the following code that works fine in javascript.

kendo.drawing.drawDOM($(".content-wrapper"))

but when I switched over to Typescript, I get the following error.

Argument of type 'JQuery' is not assignable to parameter of type 'HTMLElement'

 

HTMLElement is defined in ..\typescript\kendo.all.d.ts as

interface HTMLElement {
    kendoBindingTarget: kendo.data.BindingTarget;
}

 BindingTarget is defined as

    class BindingTarget {
        target: any;
        options: any;
        source: any;
    }

 

How do I convert the following code to typescript?

kendo.drawing.drawDOM($(".content-wrapper"))

 

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 18 May 2015, 10:49 AM

Hello Xavier,

It looks like an issue in the TypeScript definitions of Kendo UI. It will be fixed with the next internal build, that should be released by the end of the week.

Thanks for reporting this.

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
Xavier
Top achievements
Rank 1
answered on 21 May 2015, 05:54 PM

I also find it odd that categoryAxis and ValueAxis is defined as array.

interface ChartOptions {

....

valueAxis?: ChartValueAxisItem[];

categoryAxis?: ChartCategoryAxisItem[];

....

 

so I have to use it as

                    categoryAxis: [
                        {
                            baseUnit: "fit",
                            maxDateGroups: 30
                        },
                    ],
                    valueAxis: [
                        { max : 10, min: 0  }
                    ],

 I don't understand why these are an array?

 

 

 

 

0
Kiril Nikolov
Telerik team
answered on 22 May 2015, 10:38 AM

Hello Xavier,

It has been like this since the first releases of the Chart, so we cannot change it now, as it will be a breaking change. However it is the same for both TypeScript and the standard JavaScript.

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
Drawing API
Asked by
Xavier
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Xavier
Top achievements
Rank 1
Share this question
or