2012-12-19 61 views
2

我使用treeTable plugin來創建和操作樹控件。我已經將類分配給樹的不同級別。對於最低級別,我有幾個同級的節點。如何使用treeTable顯示功能?

我試圖使用API​​的揭示功能,但它只有一半的工作。這些示例僅適用於一個節點:

$("#gq-report-list tr.er-level-4.child-of-tmpl-1").reveal(); // Works for one node 
$("#gq-report-list tr.er-level-4").reveal(); // Works for one node 
$("#gq-report-list").find(".er-level-4").closest('tr').reveal(); // Works for one node 
$("#gq-report-list").find(".owner-shared").closest('tr').reveal(); // Works for one node 

我需要根據查找結果顯示多個節點。在這個片段中,有9個節點可以顯示,但只有第一個節點是:

rows = $("#gq-report-list").find(".private"); // Works for one node, but there are 9 
alert(rows.length); 
rows.closest('tr').reveal(); 

任何想法?

謝謝。

回答

0
$("#yourtreetable").treetable("reveal", "id"); 
+1

儘管這段代碼可能有助於解決問題,但它並沒有解釋_why_和/或_how_它是如何回答問題的。提供這種附加背景將顯着提高其長期教育價值。請[編輯]您的答案以添加解釋,包括適用的限制和假設。 –