Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all!
I've created a hierarchy displayed as a treeview.
When a user clicks on a parent all children are automatically selected.
This seems to work well, however a problem occurs when a user has clicked on a leaf node (one selected value) and after that uses CTRL and selects an additional value. In that case the new value(s) will not be selected.
(.. but if the user uses CTRL and remove the leaf node and selects 2 or more new items it works....)
Solution anyone? See attached .qvw file. I'm using QV 11.20
I've been using some trigger actions and a variable to accomplish the task so far.
Thanks,
OIav
Hi Olav
I have a treeview in another application and I don't get the same problem. I have just tried your example, when I removed all triggers it seemed to work! Do you need the triggers?
Erica
Hi Erica,
The triggers are necessary, as I want to select all children when a parent is clicked, not only the one you click.
The default treeview function will not select all children automatically.
Thanks,
Olav
I would avoid triggers. It is much better to build this kind of logic into the data model. In your case, you could add a "Trees" table to your data model and make the selection there instead. Then you would select entire sub-trees.
Read more about a "Trees" table on Unbalanced, n-level hierarchies
HIC
I agree with henric. When you select the top of a hierarchy, all tyhe children are selected anyway in the Belongsto table (so all the Akt_Foreldrenavn are selected). So the best option is to design the app around this hierarchical funcationality
Having said that, your triggers seem to work fine on my machine (QV10 sr6?)
Erica