Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#7187 closed enhancement (fixed)

Tree: loaded event

Reported by: Les Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.1.1
Keywords: Tree, dijit Cc:
Blocked By: Blocking:

Description

I'd be grateful if tree loaded event could be added to the dijit.Tree widget :)

Here's the code I currently use (dojo 1.0.2) to simulate this event:

dojo.connect(dijit.Tree.prototype, '_onLoadAllItems', function(/*_TreeNode*/ node, /*dojo.data.Item[]*/ items) {
  var tree = this;
  if(!tree._loaded) {
    dojo.publish(tree.id + '-loaded', [tree]);
    tree._loaded = true;
  }
});

Change History (10)

comment:1 Changed 11 years ago by bill

Milestone: tbd2.0

comment:2 in reply to:  description Changed 11 years ago by Les

Hi! Would it be possible to move this ticket to rel. 1.3?

comment:3 Changed 11 years ago by bill

Just FYI the function above will fire as soon as the top level of nodes has loaded. If the users has opened up the tree two or more levels deep, and that info is saved in a cookie, then the event will fire prematurely.

Not sure when I'll have time to get to this; will do my best.

comment:4 Changed 10 years ago by bill

Summary: Tree loaded eventTree: loaded event

comment:5 Changed 10 years ago by bill

Milestone: 2.01.4
Owner: set to bill
Status: newassigned

comment:6 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

Fixed in [20505].

comment:7 Changed 10 years ago by bill

(In [20506]) Cleanup on Tree onLoad event. Refs #7187 !strict

comment:8 Changed 10 years ago by bill

(In [20510]) Cleanup on Tree _setPathAttr(), related to onLoad event work. Fixes #10054, refs #7187 !strict

comment:9 Changed 10 years ago by bill

(In [20511]) Simplification by using DeferredList?, thanks Les, refs #7187 !strict

comment:10 Changed 10 years ago by bill

(In [20513]) Can't directly call expand()/collapse() on TreeNode?'s anymore, since Tree._expandNode() and _collapseNode() do bookkeeping stuff. (It really wasn't supported before either.) Should have some public interfaces for mucking w/Tree but for now just change test to work. Refs #7187 !strict

Note: See TracTickets for help on using tickets.