I'm trying something new. I want to use a tree control as a menu, but I really have not worked with the tree control before. I have a database that I read containing menu items of varying depths.
I think that I'm pretty close as you can tell if you run the attached VI. The problem is that I get this for an output:
When I really want this:
Is there any way to do this using a specific command in the Tree API or do I really need to parse it out in specific arrays (tough because of tracking the depths)? Is this overkill for a menu? Am I parking up the wrong tree?
The attached VI is in 8.6.
Solved! Go to Solution.
Have you tried dragging and dropping the items (with ctrl) onto the segments that you want them to be nested under?
This is what I was able to come up with by just dragging things around.
Instead of "Add item to end", I think you need to just use "Add item", which allows you to specify a parent tag. If you specify a parent tag, you can explicitly say which string you want nested under which other string. You might have to redo your formatting and parsing.
Also, you need to enforce dataflow on your two property nodes. The way you have it now, either one could randomly run first.
Thanks for replying!!
The one thing that I wasn't clear on is depending on the type of system the user selects, the menu is dynamic hence the reason for having to read a database. So, moving items around to get them in the proper order would not work. After reading the database, the menu just has to be.
Kyle - I'll try the Add Item method and report back. Thanks for the prompt that there are other methods to work with and try out.
Barking.... not Parking!!!
BTW: Anyone have thoughts on this? I may have gotten closer to what I want, unfortunately I have had to set it aside for a little bit.
I'll go through it here in a little while. Yes, it does the sorting perfectly. Thanks, now I know it can be done. I was sure it could be but I don't know the tree API as well as maybe I should.
Jamiva, nice solution and not ugly at all!
You can get the tag directly but either Reverse string and search for * (and reverse it back) or there's a reg exp character that searches from the back.
The Tree all tags should be kept in a shift register so you don't need to read from the Control for more speed.