esvit / ng-table

Simple table with sorting and filtering on AngularJS
http://esvit.github.io/ng-table
BSD 3-Clause "New" or "Revised" License
2.77k stars 851 forks source link

In line editing #912

Open aauronn opened 8 years ago

aauronn commented 8 years ago

Whenever you enable a row to edit, and then cancel, it takes the value of the first row.

anuja-joshi commented 8 years ago

@aauronn this is not issue with ng-table. But yes, there is an issue with demo. function resetRow(line 42) in demo is returning incorrect row, that should be changed to:

    function resetRow(row, rowForm){
      row.isEditing = false;
      rowForm.$setPristine();
      self.tableTracker.untrack(row);
      return _.findWhere(originalData, {id: row.id});
    }
anuja-joshi commented 8 years ago

Here is link to the codepen(forked from the current in-line editing demo's codepen) which has resolved this in-line editing issue from the demo.

roccomuso commented 7 years ago

I've lost 1 hour trying to figure it out. Published Demo still have this bug. Perhaps a PR is needed. :')

nvbugtong commented 7 years ago

any one knows why does tableTracker.untrack(row) is not working on this issue?