Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
Ned!, Richard Rose.pcs.crosspost, Peter Holemans, Riichard Rose.pcs.crosspost

Recursive Tree Structure

Startbeitrag von Riichard Rose.pcs.crosspost am 13.05.2013 16:27

I need to do a recursive tree structure, but cant see any way to declare an Alias in the Analysis which I would have been required to do in Clarion, and looking through the various Tree related examples, there are no recursive examples.

So is it possible without much effort to make a recursive tree control in Windev?

Message forwarded from pcsoft.us.windev

Antworten:

Hi Richard,

Sure there is...
1) Treeview control: here you can define a reflexive link to the same table as data source
2) SQL/Query: What you are referring to is called a 'reflexive join' in SQL. You may try this as data source

Cheers,

Peter H..

von Peter Holemans - am 13.05.2013 18:53
Hi Peter

I found Ben Dells blog post titled "Replacing Recursive Tree (Ultratree) in Windev" after posting my original question, however my db table layout is different.


I have this table structure
Table1
ID
ParentID (relates 1:Mto ID above)
DescriptionID (relates M:1 to description table)


Description Table
DescriptionID (1:M to Table1 above)
Description


I need to show the description in the tree control but there doesnt seem to be any way I can do this or maybe I am missing the point of something from your post?

I can build a tree control just like Bens blog post without any problems but I cant fit the above table layout into a tree control. I might be able to manually write some code to achieve this in windev but its actually a very complex database structure, the above is simplified example.

I've prototyped it in Clarion to test the theory and it works but other limitations prevents Clarion from being used in this case which is why I'm trying to see if Windev can do it. If not I might have to move onto another language or go back to C/C++ and code it that way.

So can anyone input any more info on how I can link in the Description table and display the description in the tree control?

TIA




Message forwarded from pcsoft.us.windev

von Richard Rose.pcs.crosspost - am 14.05.2013 15:03
Hi Richard,

You should be able to do this by creating a query that returns the Table1.ID, Table1.ParentID and TableDescription.Description.

You can base your TreeView on the Query.
On the content tab:
Set the Source to use the query
Set Browse to be Query1.Table1ID
Set Displayed to be Query1.TableDescription (Description)

Use the reflexive link option with Query1.Table1ID and link it to Query1.Table1ParentID (I forget which way round they go)

I have attached an image file with how it might work, hope this helps.

Ned!
[attachment 337 TreeView.png]

von Ned! - am 14.05.2013 15:42
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.