1318 |
alexandre_ |
1 |
/*
|
|
|
2 |
Copyright (c) 2004-2006, The Dojo Foundation
|
|
|
3 |
All Rights Reserved.
|
|
|
4 |
|
|
|
5 |
Licensed under the Academic Free License version 2.1 or above OR the
|
|
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
|
|
7 |
|
|
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
|
|
9 |
*/
|
|
|
10 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.provide("dojo.widget.TreeExpandToNodeOnSelect");
|
|
|
14 |
dojo.require("dojo.widget.HtmlWidget");
|
|
|
15 |
dojo.widget.defineWidget("dojo.widget.TreeExpandToNodeOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", withSelected:false, initialize:function () {
|
|
|
16 |
this.selector = dojo.widget.byId(this.selector);
|
|
|
17 |
this.controller = dojo.widget.byId(this.controller);
|
|
|
18 |
dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
|
|
|
19 |
}, onSelectEvent:function (message) {
|
|
|
20 |
this.controller.expandToNode(message.node, this.withSelected);
|
|
|
21 |
}});
|
|
|
22 |
|