04-13-2023 09:52 AM - edited 04-13-2023 10:00 AM
Hi,
I am developing my first VCD and I noticed that in the System Explorer, when navigating my CD tree, the items sometimes get alphabetically sorted.
It happens only on the first time that I expand one of my sections after building the tree.
Also, the tree is only partially sorted, as some sections still have their children in the original (non-alphabetical) order.
How can I disable this? I want the items to be displayed in the order in which I added them.
As the sorting is only partial, it seems more like a bug to me…
Here is an example of my tree after the unwanted sorting where my Channels "C" and "M" were originally created in the inverse order "M" then "C".
Also C's children were sorted as C, F, H, S, while M's children still have the original order F, C, H, S.
Thanks for your help,
Raphaël.
Solved! Go to Solution.
04-13-2023 12:32 PM
Hey,
you should add <ExcludeFromAlphabeticalOrder>true</ExcludeFromAlphabeticalOrder> Custom Device XML Tag to the CD page definition in your custom device XML.
04-13-2023 02:46 PM - edited 04-13-2023 02:46 PM
04-13-2023 03:36 PM
Well, it works quite well for list of channels with enumerated names (like ChnName_###) but for more complicated trees with mixture of channels and section pages it simply sorts items with it's own weird logic.
04-14-2023 03:09 AM
The logic of sorting is simply the order how it was added (how it is physically store in nivssysdef file)...
CLA, CTA
04-20-2023 04:40 AM - edited 04-20-2023 04:48 AM
After further testing, it seems the way the System Explorer is displaying tree items is even weirder than I thought.
Sorry I had to unmark the proposed solution because I found even more sorting/display problems:
1. Clicking on the built-in menu item "Open Item Hierarchy" moves the selected item to its alphabetical order, even with the appropriate XML tag supposed to prevent that.
Example:
Initial situation:
After clicking "Open Item Hierarchy" on section "C" (All pages have the XML tag to remove automatic sorting though):
2. Building the tree at the initialization of the VCD (within InitializationVI) causes an incomplete display of the generated items. I must then click on "Open Item Hierarchy" to force displaying the missing items. On the contrary, building the tree after the VCD creation (e.g. by a menu action) will display all the items correctly.
Example:
Building the tree at Initialization: missing channel "C" (I must then click on "Open Item Hierarchy" to force the appearance of the missing item):
Building the tree after the VCD creation: all channels are correctly displayed at once:
3. Also when building the tree at initialization, the generated sections have inconsistent expansion state. Some are initially open while other are initially closed without apparent logic. On the contrary, building the tree after the VCD creation will make all the generated sections expanded.
This is a bit of a pain to try to cancel what the tree is doing wrong… The original item order is important for the user because it defines how blocks of data are sent through our protocol.
So I have further questions:
A. Is there a way to remove the built-in items "Open Item Hierarchy" and "Close Item Hierarchy". I don't know if they behave like that for performance reasons or if they are just poorly coded, but I would prefer having nothing rather than counterintuitive functionalities.
B. Is there a way to control the expanded state for each item during or after tree creation ? My tree is quite complicated and navigating through inconsistently opened and closed items may be a pain for the user.
Thanks,
Raphaël.
07-10-2023 10:40 AM