简体   繁体   English

如何从sql查询结果中生成一个dynatree?

[英]How to make a dynatree from sql query results?

I'm trying to make a dynatree for a selection of overlays for googlemaps. 我正在尝试为googlemaps的叠加层选择制作一个动态树。 screenshot here: http://i.imgur.com/TgLHEnn.png 此处的屏幕截图: http : //i.imgur.com/TgLHEnn.png

Now I'm having trouble making the dynatree's content dynamic. 现在,我无法使动态树的内容动态化。 User's should be able to upload these maps and it'd be available to be selected in the tree. 用户应该能够上传这些地图,并且可以在树中进行选择。

In the screenshot, the tree is working perfectly but its content is static because i declared it in the .js file. 在屏幕截图中,该树运行正常,但其内容是静态的,因为我在.js文件中声明了它。 Turning the php sql array into the "tree" array is what's puzzling me. 把php sql数组变成“ tree”数组让我感到困惑。 Any ideas? 有任何想法吗?

您只需要根据查询结果创建JSON数据或JS数组,就可以根据需要使用ajax或children选项将其设置为树。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM