3.2.0

Tree with checkbox

Hi,
For example, I am using the following code:
var MyTreeCheckbox = AW.Tree.Item.subclass(); 

MyTreeCheckbox.create = function(){ 
    AW.Templates.Checkbox.create.call(this); 
} 

var treeValue = ["", true, false, "mixed", false, true, false]; 
var treeText = ["", "Home", "Favorites", "Font size", "Search", "Child1", "Child2"]; 
var treeImage = ["", "home", "favorites", "fontsize", "search"]; 
var treeView = {0:[1, 2, 3, 4], 1:[5, 6], 2:[7], 3:[8], 4:[9]}; 

var tree = new AW.UI.Tree; 
tree.setItemTemplate(new MyTreeCheckbox); 
tree.setItemValue(treeValue); 
tree.setItemText(treeText); 
tree.setItemImage(treeImage); 
tree.setViewCount(function(i){return treeView[i] ? treeView[i].length : 0}); 
tree.setViewIndices(function(i){return treeView[i]}); 
document.write(tree);
tree.onItemClicked = function(event, i){ 
        alert(i); 
}


But tree.onItemClicked dsn't work?
Please help.
Thanks.
Igor K.
August 27,
Yes, this is a bug - onItemClicked does not fire because checkbox calls refresh() on the clicked item. Try using onItemMouseDown(event, i) or onItemValueChanged(value, i) events.
Alex (ActiveWidgets)
August 27,
OK!
Thanks.
Igor K.
August 28,

This topic is archived.

See also:


Back to support forum