Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Tree,treeBoxObject,getCellAt不是函数吗?_Javascript_Xul - Fatal编程技术网

Javascript Tree,treeBoxObject,getCellAt不是函数吗?

Javascript Tree,treeBoxObject,getCellAt不是函数吗?,javascript,xul,Javascript,Xul,我想获取所选treecell的值,但是我得到了“tbo.getCellAt不是函数”错误,当我添加QueryInterface函数时,我得到了Erreur:NS_NOINTERFACE:Component返回的故障代码:0x80004002(NS_NOINTERFACE)[nsISupports.QueryInterface]这就是我正在使用的: function onTreeClicked(event){ var tree = document.getElementById("treeChil

我想获取所选treecell的值,但是我得到了“tbo.getCellAt不是函数”错误,当我添加
QueryInterface
函数时,我得到了
Erreur:NS_NOINTERFACE:Component返回的故障代码:0x80004002(NS_NOINTERFACE)[nsISupports.QueryInterface]
这就是我正在使用的:

function onTreeClicked(event){
var tree = document.getElementById("treeChildren_links");
var tbo = tree.treeBoxObject;
var row = { }, col = { }, child = { };
//~ tbo.QueryInterface(Components.interfaces.nsITreeBoxObject);
tbo.getCellAt(event.clientX, event.clientY, row, col, child);

var cellText = tree.view.getCellText(row.value, col.value);
alert(cellText);
var redText = getMainWindow().document.getElementById(cellText);
redText.scrollIntoView("true");
}
我做错了什么


谢谢。

我解决了这个问题,问题出在id上,我给出了一个错误的id(
document.getElementById(“树链接”);
),而不是给出父id(树),我使用的是子id(treechildren)