Home > database >  Pb new node click how to increase the added two nodes? Should be a node to be!
Pb new node click how to increase the added two nodes? Should be a node to be!

Time:09-29

Pb new node click how to increase the added two nodes? Should be a node to be!

CodePudding user response:

You still look at your code,

Should be no problem,

CodePudding user response:

If tv_1. The getitem (ii_handle, tv_item)=1 then return
Tv_item. Label=ls_mess
The select Max (to_number (treeid)) into: ls_treeid from bm_bqbmb0_tree;
Ll_treeid=long (ls_treeid) + 1
Ls_parentid=string (tv_item. Data)
Ls_treeid=string (ll_treeid)
Insert into bm_bqbmb0_tree (treeid, treename, parentid)
Values (: ls_treeid, : ls_mess, : ls_parentid);
If the sqlca. Sqlcode<> 0 then
Messagebox (" prompt ", "generate data failed!" + the sqlca. Sqlerrtext)
Return
The else
commit;
Ltvi_new. Label=ls_mess
Ltvi_new. Data=https://bbs.csdn.net/topics/ls_treeid
Ltvi_new. Children=false
//tv_1. Insertitemlast (ii_handle ltvi_new)
Tv_1. Expanditem (ii_handle)
Messagebox (" prompt ", "new disease coding success!" )
end if

CodePudding user response:

Is this sentence tv_1 insertitemlast (ii_handle ltvi_new)
Plus it will increase the two nodes, without a also don't show, but the database is right, only added a data

CodePudding user response:

In ExpandItem ever written, or other place

CodePudding user response:

One is to increase the yourself, and a is itempopulate activates automatically add

You can be increased in such processing

For your reference code
Treeviewitem tv_cur, tv_new
Long ll_root, new_handle
String ls_closetype
//
Ist_parm. Opentype="add"
Ls_closetype=gs_closetype
Ist_parm. Int2=ai_parentid
Gs_closetype='0'
Openwithparm (w_knowledge_add ist_parm, this)
If gs_closetype='1' then
//if the click ok button or cancel button
Ist_parm=message. Powerobjectparm
If ist_parm. Closetype='ok' then
Ll_root=tv_1. The getitem (al_handle tv_cur)
If ll_root & lt;> 1 then

If tv_cur. ExpandedOnce=true and tv_cur. Children=true then
//if the current node has been children
Tv_new. SelectedPictureIndex=3
Tv_new. PictureIndex=2

Tv_new. Label=ist_parm. String4
If ist_parm. Int4 & lt; 5 then tv_new. Label=tv_new. Label + "[" + levelcode [ist_parm. Int4] +"] "
Tv_new. Data=https://bbs.csdn.net/topics/string (ist_parm. Int3)

New_handle=tv_1. InsertItemlast (al_handle tv_new)
The else
//if there is no child node
Tv_cur. Children=true
Tv_1. SetItem (al_handle tv_cur)
End the if
End the if
End the if
//
//
////ClassicGSMType
////messagebox (" ", "1")
End the if
Gs_closetype=ls_closetype

return 0

CodePudding user response:

If add this if tv_cur. On the basis of my ExpandedOnce=true and tv_cur. Children=true then
It is ok to judge? How do I add new did not show up in the interface

CodePudding user response:

Is that before adding nodes, you can judge
  • Related