How can I change color cell only if the value change?

I want to change the text color only if the text change at the cell in datagrid. How can i save the old value and compare it to the new value the user enter? I saw all the example at FAQ but its not help me. Thanks, Ravit.

Loader.
Up arrow icon