Shouldn’t be because I copied from here
Ok, so I assume you also have copied grid.addClassName("styling");
that’s good catch. Now it worked but with a new problem
it is showing all edited items
Are you refreshing the previous item as well, as Rolf suggested?
Yeah, the “styling” classname is just part of the example implementation, you don’t need to do that part. (Come to think of it we could probably remove it from the style sheet to avoid confusion)
Yep. This is the latest code ( if someone wants to copy ) private void highlightEditedUnit(Unit modifiedUnit) { Optional<Unit> prevUnit = Optional.ofNullable(lastModifiedUnit); lastModifiedUnit = modifiedUnit; refreshGrid(modifiedUnit); prevUnit.ifPresent(unit -> refreshGrid(unit)); }
Now it is working perfectly as expected