Kendo UI grid dataItem and sender errors. Help

2 posts, 0 answers
  1. Bobby
    Bobby avatar
    2 posts
    Member since:
    May 2017

    Posted 03 May 2017 Link to this post

    When trying to edit, add or delete from a grid I am using the external form or reactive forms editing customization setup described on the Kendo UI site. I'm getting these 2 errors

    Build:Binding element 'dataItem' implicitly has an 'any' type 

    Build:Binding element 'sender' implicitly has an 'any' type 

    These are the locations where they are called. Any suggestions would help. Thanks

     protected addHandler({ sender }) {
          protected addHandler(sender: any) {
                this.closeEditor(sender);
                
            sender.addRow(new Product());

    }

    public editHandler({ dataItem }) {
            this.editDataItem = dataItem;
            this.isNew = false;
        }

     

     

  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 05 May 2017 Link to this post

    Hello Bobby,

    The error message you have pasted is due to having the noImplicitAny tsconfig option enabled and not having a type defined. In order to resolve it you should either modify the signature to have any type as the following:

    public addHandler({ sender }: any): void {
    //....
    public editHandler({ dataItem }: any): void{
    //...
     
    |or the actual event type shape:

    public addHandler({ sender }: { dataItem: any, isNew: boolean, rowIndex: number, sender: GridComponent} ): void {
    //..
    public editHandler({ dataItem }: { dataItem: any, isNew: boolean, rowIndex: number, sender: GridComponent }): void {
    //..


    Regards,
    Rosen
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top