Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
How to get original cell value on client?
posted

If I first time change cell value on client in webgrid, I can get get new value: cell.getValue() and previous value: cell.getOldValue().

For example:

1) original value: 10

2) I change it to 11, after this: cell.getValue() == 11 and cell.getOldValue() == 10

3) I change it from 11 to 12, after this: cell.getValue == 12 and cell.getOldValue == 11 and so on...

Is there way to get original cell value from server? i.e 10 in my case 

  • 8680
    posted

    I'd create a separate, hidden column containing the original values.

  • 28464
    posted

    As far as I know the grid does not have anything built-in to support that. I would guess that you may need to write some additional javascript code - for example you can create a new array and the first time you setValue for the cell you can store the original value in a javascript array (the key could be the ID of the cell - it is unique). Then, on subsequent changes, if the javascript array has already value set of this key, then just do nothing - and then restore the original value from the javascript array.