1
("#tree").dynatree({                
minExpandLevel: 1,              
//persist: true,                
children: [{"title":"First Location",
"isFolder":true,
"expand":true,
"key":"location.92",
"icon":"location.gif",
"children":[{"title":"<span class='assetType'>First Location Child<\/span>",
"key":"locationid=92&typeid=1",
"expand":true,
"icon":"equipment.gif",
"children":[ (etc...)

私もです:

var rootNode = $("#tree").dynatree("getRoot");
var title = rootNode.data.title;

title = null

...わかりましたので、試してみます:

var rootNode = $("#tree").dynatree("getRoot");
var node = rootNode.getChildren();
var title = node.data.title;

未定義のプロパティ「タイトル」を読み取ることができません

もし私がちょうど:

alert(node);

私は得る:

DynaTreeNode<location.92>: '最初の場所'

そう...?

そして、私が尋ねているので、コンソールで:

jquery.dynatree.min.js:710:49:53.215 - Option 'title' is no longer supported.

?

関連している?

Uncaught TypeError: Cannot read property 'parentNode' of null
ra
4

3 に答える 3

5

rootNode は (非表示の) システム ルートでrootNode.data.titleあり、設定されていません。node.getChildren() はリストを返すため、

var rootNode = $("#tree").dynatree("getRoot");
var nodeList = rootNode.getChildren();
var title = nodeList[0].data.title;
于 2010-12-31T08:15:28.397 に答える
2

私は答えを持っています:

//node = item which has isFolder() = false, islazy() = false

var topnode = node.parent;
topnode.reloadChildren(function(topnode, isOk){});
于 2012-03-01T12:00:49.840 に答える