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

cellClick event not being carried into handler?

1 Answer 1844 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BitShift
Top achievements
Rank 1
Veteran
BitShift asked on 19 Apr 2019, 04:43 PM

Going off this example
https://www.telerik.com/kendo-angular-ui/components/grid/editing/editing-row-click/#preview-2

Im having trouble with inline editing.  When I click on a cell, my click handler gets called, but no event information is carried over.  Im using the safe-nav operator because the grid wont have data until some other actions happen which results in an api call to fetch data.  The grid loads fine, but the $event doesnt seem to get carried into the click handler.

grid:

<kendo-grid [data]="selectedOrder?.lineItems" id="lineItemGrid"
                                            [height]="360" (cellClick)="cellClickHandler($event)">

 

click handler:  when this method is hit in the debug console, the parameters are undefined.  What can I check to see why?

public cellClickHandler({ isEdited, dataItem, rowIndex }): void {
    if (isEdited || (this.formGroup && !this.formGroup.valid)) {
        return;
    }
 
    this.saveCurrent();
 
    this.formGroup = createFormGroup(dataItem);
    this.editedRowIndex = rowIndex;
 
    this.lineItemGrid.editRow(rowIndex);
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 23 Apr 2019, 07:14 AM
Hello Randal,

Clicking the Grid cells after the data is populated successfully should result in all relevant event data coming as expected in the cellClick event handler:

https://stackblitz.com/edit/angular-pqayze-iji8tu?file=app/app.component.ts

I tried to replicate the described scenario in the example above, but the cellClick handler is still receiving all expected arguments.

Can you please send us a similar isolated runnable project where the issue can be observed, or modify the one above until the problem appears, so we can inspect it further, and determine what is causing the undesired behavior in the specific use case? Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
BitShift
Top achievements
Rank 1
Veteran
Answers by
Dimiter Topalov
Telerik team
Share this question
or