2011-03-24 3 views
1

내 사이트에 두 개의 버튼이 있습니다. http://plugins.jquery.com/project/treeviewjQuery treeView plugin 축소/모두 확장

내가 그 일에 대한 해결책을 찾을 수 없습니다 : : 모든 확장, 모든

임 사용하여 트리 뷰 jQuery 플러그인을 축소/메신저 발생 UL 리 목록 동적 영문 서버 측 코드에 내가 할 싶지만 또한

다른 노드가 닫히는 동안 어떤 노드가 확장되어야 하는지를 queryString 매개 변수에 일치시키는 지 결정합니다. 주어진 하나씩 있지만 아무 것도 작동하지 않았다 각 클래스에 추가 시도했다 :/

어떤 노드를 확장해야한다고 어떻게 말할 수 있습니까? 어떤 도움

감사합니다, 안녕

+0

가능한 중복 http://stackoverflow.com/questions/2603653/how-do-i-create-expand -all-and-collapse-all-links-outside-of-the-jquery-treeview) –

답변

3

당신이 demo's를 보면 당신은 정확하게 당신이 예 4.

을 위해 필요한 참조 페이지에 다음을 추가한다 :

<div id="treecontrol"> 
    <a title="Collapse the entire tree below" href="#"><img src="../images/minus.gif" /> Collapse All</a> 
    <a title="Expand the entire tree below" href="#"><img src="../images/plus.gif" /> Expand All</a> 
    <a title="Toggle the tree below, opening closed branches, closing open branches" href="#">Toggle All</a> 
</div> 

을 그리고 트리 컨트롤을 연결하면 'treecontrol'을 지정하십시오.

$("#black, #gray").treeview({ 
    control: "#treecontrol" 
}); 

경고하십시오
플러그인이 .eq()을 사용하여 적절한 기능을 할당하므로 앵커 태그의 순서가 중요합니다.

$("a:eq(0)", control).click(handler(CLASSES.collapsable)); 
// click on second to expand tree 
$("a:eq(1)", control).click(handler(CLASSES.expandable)); 
// click on third to toggle tree 
$("a:eq(2)", control).click(handler()); 
[I 모든를 확장하고 jQuery를 트 리뷰 플러그인의 외부 모든 링크를 축소 만들기 어떻게?]의 (
+0

오 그게 있습니다 :) – gruber

+1

제공된 링크가 작동하지 않습니다. – user2173353