I am creating application that contains a DataGrid
which has 4 columns (name, hours, rate, total)
.
What I want is to update the total cell whenever the hours or rate values changes.
you may say:
object.setTotal(object.getHours() * object.getRate());
...but I want to know how to update the cell value itself without redrawing the row or the DataGrid. Is this possible?
I got the answer: I used DOM to access the control and update the value. of course I named each control in the DataGrid, for example First row (id=name0, id=hours0, rate0, total0) and so on.
InputElement ele = DOM.getElementById( "total" + context.getIndex()).cast();
ele.setValue(object.getTotal());