anychart.onDocumentReady(function () {
var stage = anychart.graphics.create('container');
treeData = anychart.data.tree(data, 'as-tree');
var dataGrid = anychart.standalones.dataGrid();
dataGrid.headerHeight(25);
var title = anychart.standalones.title();
title.text('Click buttons above to see results');
treeData.listen('treeItemUpdate', function(e){
title.text('The item "' + e.item.get('name') +'" was updated');
dataGrid.container(stage);
if (i < treeData.numChildren()) {
var item = treeData.getChildAt(i);
item.set("name", item.get("name") + " has index " + i);