Primeng: DataTable OnEditComplete Event Not Firing When Field Being Edited Loses Focus

Created on 2 Jun 2017  路  19Comments  路  Source: primefaces/primeng

I'm submitting a ...

[X] bug report
[ ] feature request
[ ] support request

http://plnkr.co/edit/Lvy82I95GtsNi06c8h4x?p=preview

Current behavior
When completing an edit in the DataTable by clicking outside of the field being edited, the OnEditComplete event does not run.

Expected behavior
The OnEditComplete event should run whenever the field being edited loses focus.

  • Angular version: 4.0.X
  • PrimeNG version: 4.0.3
  • Browser: [Chrome]
  • Language: [TypeScript 2.2.2]
pending-review

Most helpful comment

In p-table too onEditComplete is not working,
Please resolve this problem

All 19 comments

This should be fixed in recent PrimeNG release, please try with it and if the issue persists drop a comment with along with a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/Wj39h1?p=preview

Seems to still exist as of 4.1.0-rc2 and Angular 4.2.4

http://plnkr.co/edit/1QP10X0DL8Zs1HcW4rl9?p=preview

initially, #2535 reported as

DataTable onEditComplete Event is not fired when user hit "Tab" on keyboard or any other method to navigate out of the Editable column.

However, developer changed it and support when user click the "Tab" key.

Could you please say when it will be fixed ?

Same problem here. Is a good idea when user clicks outside, the content of the cell can (at least) revert to the original content. If user does click outside and the content is the new one, then the user could feel that the contents is saved.

Yes, I too am having a real problem with not having onBlur event at table or cell level. We are saving row data when user tabs out of last column, or user clicks in another row field. When user clicks in field of another row, we lose context of previous row so have to make a work around.

3138 provides more detail on this issue.

Hi i am not able to fire event on onEditComplete, onValueChange, onEditCancel in p-datatable so Could you please say how to resolve it.

p-dataTable is deprecated and will be removed in favor of the new p-table (aka TurboTable) of 5.1.0 so closing the issue. Please try the new p-table once 5.1.0 is released.

In p-table too onEditComplete is not working,
Please resolve this problem

Improvement --> In p-table onEditComplete works only when Enter key is pressed. Is it possible to enable this to tab key?, I saw the implementation and is only available for Enter key.

Have same issue, it's not getting fired even in turbo table.

For me, it has worked calling the method focusout in the input, and then, manipulating editingcell

In html:
<p-table #tableId> <p-cellEditor *ngIf="col.editable != undefined && col.editable"> <ng-template pTemplate="input"> <input type="text" (focusout)="focusoutcell(tableId)"/> </ng-template> </p-table>

In ts:
focusoutcell(table) { $(table.editingCell).removeClass('ui-editing-cell'); table.editingCell = null; }

Same error here in turbo table.

plz help

Same error here

When we made change in one input field and then click on another input field it doesn't fire onEditComplete event. however it works for enter and tab key

Yes, this is still a problem. Clicking between input fields doesn't trigger onEditComplete event. Anyone got a fix for that?

@mikeveltman - Did you have any luck in fixing this?

@michaelferry We made custom cell-input and cell-display components. The custom cell-input component outputs a cellEditComplete event at a blur event of the input inside the cell-input component. But the issue itself is not fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cagataycivici picture cagataycivici  路  36Comments

StevenLiekens picture StevenLiekens  路  36Comments

agusdutra picture agusdutra  路  52Comments

danielkay picture danielkay  路  39Comments

sourdoth picture sourdoth  路  34Comments