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

Kendo UI grid dataItem and sender errors. Help

1 Answer 380 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bobby
Top achievements
Rank 1
Bobby asked on 03 May 2017, 04:52 PM

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;
    }

 

 

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 05 May 2017, 01:29 PM

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.
Tags
Grid
Asked by
Bobby
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or