我已閱讀dynatree的開發人員提供的示例。其中一個顯示在節點中放置「expand:true」,它顯示從一開始就展開。 我創建SQL查詢dynatree中的展開節點
Doctrine_Core::getTable('Folder')
->createQuery('f')
->select('slug as key, nombre as title,
IF(id in ('.implode(',',$ancestors_id).'),true,false) as expand,
true as isFolder,
level');
和JSON數組返回的數組轉換。
[
{"id":"1","key":"qqwqeqwe","title":"qqwqeqwe","level":"0","expand":"true","isFolder":"1","children":
[
{"id":"2","key":"nombre-de-laaa","title":"nombre de laaa","level":"1","expand":"true","isFolder":"1","children":
[
{"id":"3","key":"tof","title":"TOF","level":"2","expand":"false","isFolder":"1","children":[]},
{"id":"4","key":"dddd","title":"dddd","level":"2","expand":"true","isFolder":"1","children":[]}
]
},
{"id":"5","key":"ffffa","title":"ffffa","level":"1","expand":"false","isFolder":"1","children":[]}
]
}
]
我把「擴大:真」的節點上,我想出現擴大,他們的祖先。但沒有擴大。
我試圖把「expand:true」只在我想擴展的節點上,但它也不起作用。 我已經測試expand:「true」並展開:true。字符串和邏輯
我在做什麼錯?
對不起,我沒有把它的職位,但我已經測試過,並沒有工作。 –