This is batch editing example for a treegrid, it's similar to batch editing for grid example with few differences.

addNodes and deleteNodes methods of Tree() are used to add and remove nodes in Treegrid instead of grid addRow and deleteRow methods.

While adding new nodes, Tree().addNodes() method expect id of the new nodes, so we generate random id with prefix "new_" which is temporary until commit. This causes these nodes to be present in both addList and updateList. We filter these out from updateList in getChanges function.

On server side: