ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

[ui-grid 3.0.0-rc16] Row is not marked dirty after cell edit

Open pmariduena opened this issue 12 years ago • 5 comments

The examples seem to work properly, but in my code, I am required to double-click another cell (start edit of another cell), before the current row is marked as "dirty". The 205 tutorial only requires a single click, which is what I want. I will post a plukr soon. I am not sure what I am doing wrong, as I've been looking at this for a while. But I think it is that my files are organized differently

pmariduena avatar Nov 25 '14 15:11 pmariduena

Here's the beginning of the plunkr: http://plnkr.co/edit/2A7jsaCZvBRu8iV615F1

But I am not done with my plunkr. I'm still not sure why 205 sample works and mine doesn't. My code runs, and I see the grid (on my local development system). The only thing not working is marking the row dirty simply clicking once off the just-edited cell.

pmariduena avatar Nov 25 '14 16:11 pmariduena

OK, I finally got the expected behavior working, but I had to explicitly set the dirty flag on each row in the on.afterCellEdit callback that I defined. In the Tutorial, it is implied we need to do this when we define our own on afterCellEdit callback (tutorial 205):

"The basic method of operation is that whenever a cell is edited (identified using the edit.afterCellEdit event) an isDirty flag is set on the row, and a saveTimer is set."

HOWEVER, I was previously provided this plunkr: http://plnkr.co/edit/SwztnW1mpIlg1oDuqWjI

by @PaulL1

where he does NOT need to define an afterCellEdit callback at all, and it works as expected. When you double-click a cell and edit, and then single click any other cell, the row is marked dirty as expected (note we are using rowWaitEditInterval = -1 for my use case).

The code I have (running 3.0.0-rc16) doesn't work that way though I'm doing the same thing. Could it be that perhaps @PaulL1 is running off of "latest" which has a fix that my version of ui-grid doesn't?

That's only explanation I can put together here. I guess in the meantime, I can continue explicitly call setRowsDirty for each modified row, until there's an explanation for the discrepancy in behavior. I'll try and update my provide plunkr so you can compare.

pmariduena avatar Nov 25 '14 19:11 pmariduena

In the plunker you provided when I edit a cell the row gets marked dirty. I can't see any reason why this wouldn't work - the afterCellEdit event is called within the rowEdit feature itself.

Is this still happening for you, and if so could you provide an updated plunker?

PaulL1 avatar Dec 07 '14 19:12 PaulL1

Yes it is still happening to me @PaulL1 . I've been working around it by explicitly calling "setRowsDirty" in the afterCellEdit callback.

I was thinking maybe you are on a more recent build then I am, and that would account for the discrepancy....but I can't confirm that with plunkr down. I'll update again once I can get plunkr up and running again.

pmariduena avatar Dec 10 '14 14:12 pmariduena

Solution offered 2 weeks ago, no comments since, assuming original issue resolved.

PaulL1 avatar Dec 26 '14 20:12 PaulL1