Home > database >  Be urgent! treeviewitem
Be urgent! treeviewitem

Time:09-30

This is my tree control in the treeview the selectionchanged event code

Treeviewitem it_new, it_old

Tv_1. The getitem (newhandle it_new)
String dataname
Dataname=trim (string (it_new. Data))
String datanamelist
datanamelist='# admininfo#' + '# shuruguanli#' + '# product_type #' + '# merchant#';
if dataname='*' then
//show "system management subfunction
"Dw_1. Title=trim (it_new. Label)
Dw_1. Visible=false
Dw_2. Visible=true
Cb_1. Visible=true
Cb_2. Visible=true
Cb_3. Visible=true
Cb_4. Visible=true
The else
If pos (' # '+ datanamelist +' # ', dataname) & gt; 0 then
Dw_1. Visible=true
Dw_1. Title='data sheet' + dataname + '(' + trim (it_new. Label) +') '+' content: '
Dw_1. Dataobject='d_ + dataname
Dw_1. Modify (datawindow. Vertical_size="300")
dw_1. Object. The # 1. The key="yes"
Dw_1. Settransobject (sqlca)
Dw_1. Retrieve ()

If dw_1. Rowcount () & gt; 0 then
Dw_1. Scrolltorow (1)
End the if
The else
Dw_1. Visible=false
Openwithparm (w_add dataname, w_login)
W_add. Sle_product_type. Text=it_new. Label
End the if
End the if


Problem: 1, datanamelist='# admininfo#' + '# shuruguanli#' + '# product_type #' + '# merchant# and dw_1 object. # 1. The key="yes" what is the meaning of the two lines of code why a "#", 2, the if dataname=' * 'rookie to this line of code what mean ah ha ha

CodePudding user response:

1, datanamelist, just string, this depends on the purpose of the developer, here he just wanted to put the string separated completely
# 1 on behalf of the first field, the key is his property, instead of yes value
2, the if dataname='*', this sentence can only answer is, 'if dataname equals *...
The code, the dataname is tree is selected item value

CodePudding user response:

1
Datanamelist='# admininfo#' + '# shuruguanli#' + '# product_type #' + '# merchant#';
Is
Datanamelist='# # # # # admininfo# shuruguanli# product_type merchant#';
The original programmer, made delimiter #, is used to find it_new. Data (see his logic, is the name of the table in the database), whether in the one of the four tables.

Dw_1. Object. The # 1. The key
Is the first column of the dw_1 (not you see the first column, but the first column in the SQL statement), it seems that the original programmer's habit is only an ID is done advocate key.

2.//the randomness, code is not complete, because you need to check the TREEVIEW. Insertitem (... ) such a statement
You look at that label (label) is "all tables" or "all data"

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

It looks like, this is a display the function of the corresponding table data, point the name of the table, according to which form of data.

CodePudding user response:

reference 1st floor javaxi response:
1, datanamelist, just string, this depends on the purpose of the developer, here he just want to put the string separated completely
# 1 on behalf of the first field, the key is his property, instead of yes value
2, the if dataname='*', this sentence can only answer is, 'if dataname equals *...
The code, the dataname is selected tree item value


Look at the first book about PB

CodePudding user response:

Label (label) is not "all tables" or "all data",
Tree control treeview's window w_main) open event code for
Treeviewitem it_1
Setpointer (hourglass!
//is a data object tv_1
Datastore itdata
itdata=https://bbs.csdn.net/topics/create datastore
Itdata. Dataobject="d_shuruguanli"
Itdata. Settrans (sqlca)
//add project to it_1
Int rows, I
Rows=itdata. Retrieve ()
For I=1 to rows
It_1. Label=itdata. Object. Cname [I]
it_1.data=https://bbs.csdn.net/topics/itdata.object.ename [I]
//set itdata object attribute
It_1. Children=false
If it_1. Data="' then
It_1. Bold=true
It_1. Pictureindex=0
It_1. Selectedpictureindex=0
The else
It_1. Bold=false
It_1. Pictureindex=1
It_1. Selectedpictureindex=2
End the if
Tv_1. Insertitemlast (0, it_1)
Next
//hide management subsystem
Dw_2. Visible=false
Cb_1. Visible=false
Cb_2. Visible=false
Cb_3. Visible=false
Cb_4. Visible=false
Dw_2. Settransobject (sqlca)
Dw_2. Retrieve ()


There is a tree control treeview selectionchanged code for
Treeviewitem it_new, it_old
Enclosing the getitem (oldhandle it_old)
Enclosing the getitem (newhandle it_new)
Dw_1. Accepttext ()
Int li_net
//judgment, modify, or delete items
If the trim (it_old. Label) & lt;> 'and (dw_1 modifiedcount () & amp;
+ dw_1. Deletedcount () & gt; 0) then
Li_net=messagebox (" prompt ", "all the changes have not save, ~ n ~ r needs to be saved?" &
That Question! , YesNoCancel!)
If li_net=1 then
If dw_1. The update ()=1 then
commit;
End the if
Elseif li_net=3 then
Return 1
End the if
End the if


Bother everybody to help me take a look at the younger brother first thanks here

CodePudding user response:

Itdata. Retrieve () is the result of the "all tables" or "all data"?

May also directly in the data window d_shuruguanli preview the results first

CodePudding user response:

To help you see what ah, do you also don't understand, upstairs several people explain the meaning of the code are not yet
As for why the if dataname='*'='*' instead of '@'=='x' or, that is your business logic, others may not know,

CodePudding user response:

Hat with the second floor, but support the upstairs

CodePudding user response:

refer to the sixth floor of AFIC reply:
to help you see what ah, do you also don't understand, upstairs several people explain the meaning of the code are not yet
As for why the if dataname='*'='*' instead of '@'=='x' or, that is your business logic, others may not know,


ding

CodePudding user response:

The line number?

CodePudding user response:

Focus on

CodePudding user response:

Code is the meaning of the already very clear

CodePudding user response:

All what person ah, such a simple question are not bashful take outnullnull
  • Related