Home > database >  Questions about the PB TREEVIEW!
Questions about the PB TREEVIEW!

Time:09-28

Below the TREEVIEW, if the current item don't have children, how to insert the items below in the current item itempopulate events?
Please advice!
Thank you very much!

CodePudding user response:

The estimates have to write the first layer node,

CodePudding user response:

Children attribute set to true

CodePudding user response:

The first layer node is written first, want to in the event of an itempopulate, determine how the current item for LEVEL1 belong to the second node, LEVEL2 stores belong to the third layer node,
Don't know how to achieve it,
Exclude please, thank you,
Here is my code
Treeviewitem tv_item

Datastore ds1, ds2
Treeviewitem tvi
Int li, li2, i1, i2
Long h1, h2, h3, h4, h5, and h6

Long ll_tvi
Int li_rvret

Ds1=create datastore
An dataobject="dw_sbcj1"
Ds1. Settransobject (sqlca)

Ds2=create datastore
Ds2. Dataobject="dw_sbcj2"
Ds2. Settransobject (sqlca)

//level=1
If tree_tv1. Level=1 then
Li=ds1. Retrieve ()
Ds1. Setsort (' id a ')
Ds1. Sort ()
For i1=1 to li
Tvi. Data=https://bbs.csdn.net/topics/ds1.getitemstring (i1, "id")
Tvi. Label=ds1. Getitemstring (i1, "id_name)
Tvi. Pictureindex=0
Tvi. Selectedpictureindex=0
Tvi. Children=true
H1=tv_1. Insertitemlast (tvi) 1,
Next
End the if

//level=2
If tree_tv1. Level=2 then
Tvi. Data=https://bbs.csdn.net/topics/tree_tv1.id
Tvi. Label=tree_tv1. Label
Tvi. Level=tree_tv1. Level

Li2=ds2. Retrieve (tvi) data)
Ds2. Setsort (' id a ')
Ds2. Sort ()
ll_tvi=tv_1. FindItem (childtreeitem! , 0)
Tv_1. Expanditem (ll_tvi)
For i2=1 to li2
Tvi. Data=https://bbs.csdn.net/topics/ds2.getitemstring (i2, "id")
Tvi. Label=ds2. Getitemstring (i2, "id_name)
Tvi. Pictureindex=0
Tvi. Selectedpictureindex=0
Tvi. Children=true
h2=tv_1. Insertitemlast (tvi) ll_tvi,
Next
End the if

DESTROY ds1
DESTROY ds2

If it is LEVEL2 stores, or under the LEVEL1,
  • Related