How do I update a treegrid node?

I have a treegrid that is not attached to a data source - just an array. I want to be able to update the node’s data after presenting a dialog box for this purpose.

I have this much working however the only way I can find to actually update the treegrid is to delete the record then re-create it with the updated values. when this happens, I can’t seem to find a way to access the relative position of the node before i delete it.

so when you edit the node in this way you can only either move it to the top or the bottom of its current folder instead of it just staying where it is.

is there an easier way to edit and refresh a treegrid node and retain the node’s position?

The actual tree nodes are just JavaScript Objects. You can make changes to their properties by normal JavaScript syntax (eg node.property = newValue) and call redraw() (or the finer-grained refreshRow() and refreshCell()) on the TreeGrid to show the changes.