Tree within a combo?
Is it possible to have a tree control within a combo control?
Peter G.
July 31,
AW.Tree.Combo = AW.UI.Tree.subclass();
AW.Tree.Combo.create = function(){
AW.UI.ImageText.create.call(this);
AW.UI.Input.create.call(this);
AW.Templates.Combo.create.call(this);
var obj = this.prototype;
obj.setClass("ui", "combo");
obj.setClass("input", "");
obj.defineTemplate("popup", new AW.Templates.Frame);
obj.onCurrentItemChanged = function(i){
var text = this.getItemText(i);
this.setControlText(text);
this.hidePopup();
var e = this.getContent("box/text").element();
e.value = text;
e.select();
e = null;
};
obj.setController("selection", {
onItemClicked: "selectClickedItem"
});
};
var treeText = ["", "Home", "Favorites", "Font size", "Search", "Child node 1", "Child node 2"];
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.Tree.Combo;
tree.setId("tree1");
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);
This topic is archived.
ActiveWidgets is a javascript library for creating user interfaces. It offers excellent performance for complex screens while staying simple, compact and easy to learn. Deployed by thousands of commercial customers in more than 70 countries worldwide.
Copyright © ActiveWidgets 2021