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

4 posts, 1 answers
  1. Xavier
    Xavier avatar
    29 posts
    Member since:
    Jun 2014

    Posted 14 May 2015 Link to this post

    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"))

     

     

     

  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 18 May 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Xavier
    Xavier avatar
    29 posts
    Member since:
    Jun 2014

    Posted 21 May 2015 Link to this post

    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?

     

     

     

     

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 22 May 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready