var treeAction = function(id) {
console.log(id);
}
treeToolbar = docLayout.cells("a").attachToolbar({
icons_path: "images/",
json: [
{ id: "expand", type: "button", text: "Expand", img: "ExpandAll.png", action: 'treeAction' },
{ id: "collapse", type: "button", text: "Collapse", img: "CollapseAll.png", action: 'treeAction' }
]
});
Pleas,e check the following snippet with your own code:
http://snippet.dhtmlx.com/ad0beb896
it works well.
If the problem still occurs for you please ,provide a complete demo or a demo link, where the problem can be reconstructed locally.