tree.ensureElementIsVisible fails if parent treeitems of element are not open.

RESOLVED WONTFIX

Status

()

Core
XUL
RESOLVED WONTFIX
17 years ago
10 years ago

People

(Reporter: Peter Wilson, Assigned: Brian Ryner (not reading))

Tracking

Trunk
Future
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Build:2001042504
tree.ensureElementIsVisible fails if parent treeitems of element are not all 
open.
Surely this function should be responsible for opening any required parent 
treeitems?
At least it should not fail:

Error: uncaught exception: [Exception... "Component returned failure code: 
0x80004005 (NS_ERROR_FAILURE) [nsITreeBoxObject.getIndexOfItem]"  nsresult: 
"0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: 
chrome://global/content/treeBindings.xml#tree.ensureElementIsVisible() :: 
ensureElementIsVisible :: line 1"  data: no]
over to trees.
Assignee: asa → hyatt
Status: UNCONFIRMED → NEW
Component: Browser-General → XP Toolkit/Widgets: Trees
Ever confirmed: true
QA Contact: doronr → jrgm

Comment 2

17 years ago
Fun for bryner!
Assignee: hyatt → bryner
(Assignee)

Comment 3

17 years ago
No actual cases of this being a problem in the product are mentioned here... ->
Future.

Status: NEW → ASSIGNED
Target Milestone: --- → Future
(Reporter)

Comment 4

17 years ago
For the record I use:

Utility.ensureParentContainersOpen(widgetTree, treeitem);
widgetTree.ensureElementIsVisible(treeitem);

Where:
/** Open parent containers for selected treeitem.
 *ensureElementIsVisible should do this - but until then...:
**/
ensureParentContainersOpen: function(tree, treeItem) {
	if (treeItem.localName != "treeitem") return;
	var element = treeItem.parentNode;
	while (element !== tree) {
		if (element.localName == "treeitem") {
			var isOpen = element.getAttribute("open");
			if (!isOpen || isOpen != "true") 
				element.setAttribute("open","true");
		}	
		element = element.parentNode;
		if (!element) break; // failsafe.
	}
},

This properly belongs in the tree xbl bindings.

Comment 5

16 years ago
tree is no more, wontfix
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WONTFIX

Updated

10 years ago
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.