PDA

View Full Version : Tooltips for each TreeItem in the Async Tree example



Bugs
3 Dec 2008, 11:17 AM
I am studying the Async Tree example (http://www.extjs.com/examples/tree/async.html) and fail to understand how it would be possible to set a tooltip for each TreeItem.

Does anyone have an idea how this could be done using the code for the above example?

frederic.bastide
4 Dec 2008, 8:17 AM
Hello,

what i'have done: create my own TreeBinder like this,
and override the createItem to settitle to the treeItem (in red in the code below):


publicclass KwTreeBinder<M extends ModelData> extends TreeBinder<ItemModel> {

public KwTreeBinder(Tree tree, TreeStore<ItemModel> store) {
super(tree, store);
// TODO Auto-generated constructor stub

}

@Override

protected TreeItem createItem(ItemModel model) {
TreeItem treeItem = super.createItem(model);
treeItem.setTitle((String)treeItem.getModel().get(this.getDisplayProperty()));

return treeItem;
}
}