请问这个DW树形结构支持多层吗?
节点1
|
——节点2
|
——节点3 ....
另外我的PB12的版本是 12.0 build 5530.是否有高级点的版本?如有麻烦各位大侠奉献下。。。不胜感激。。。bi[email protected]
------解决方案--------------------
只能通过代码实现,在dw的clicked事件中写:
string ls_band
ls_band = this.GetBandAtPointer()
long ll_row
int li_level, li_pos
li_pos = pos(ls_band , "~t")
if li_pos > 0 then
ll_row = long (mid (ls_band, li_pos + 1 , len(ls_band)))
ls_band = mid(ls_band , 1 , li_pos - 1)
if left(ls_band, 11) = 'tree.level.' then
li_level = integer(mid(ls_band, 12))
end if
if li_level <= 0 then return
if this.isexpanded( ll_row, li_level) then
this.collapse(ll_row, li_level)
else
this.expand(ll_row, li_level)
end if
end if
------解决方案--------------------
分享一下,双击那一层则自带收缩 (数据窗口 DoubleClicked 事件中处理)
string ls_dwProcessing,ls_band
// 树型 dw 的 展开,收缩 处理
ls_dwProcessing=this.describe('DataWindow.Processing')
If ls_dwProcessing='8' or ls_dwProcessing='9' Then
ls_band=this.describe(dwo.Name+".band")
//tree.level.1
//n_cst_string
If pos(ls_band,'tree.level.') >0 Then
n_cst_string lstr_c
string ls_parstr[],ls_bandrow[]
int li_level,li_row
lstr_c.of_parsetoarray(ls_band,'.',ls_parstr)//PFC 对象 把字串 分配成数组(也可以自行写)
If upperbound(ls_parstr[])>=3 Then
If isnumber(ls_parstr[3])Then
li_level=integer(ls_parstr[3])
//describe("evaluate(' first( getrow() for group 1 )',"+string(getrow())+")")
//describe("evaluate(' first( getrow() for group 1 )',"+first( getrow() for group 1 )+")")
//li_row= this.getrow()//long(describe("evaluate(' first( getrow() for group "+string(li_level)+" )',compute_3)"))
//取双击的所在 band 的行
ls_band=GetBandAtPointer()
lstr_c.of_parsetoarray(ls_band,'~t',ls_bandrow)
If upperbound(ls_bandrow[])>=2 Then
li_row=long(ls_bandrow[2])
If li_row=0 Then li_row= this.getrow()
Else
li_row= this.getrow()
End If
If this.isexpanded( li_row, li_level) Then
this.CollapseAllChildren(li_row,li_level)
//this.CollapseAll()
Else
this.ExpandAllChildren(li_row,li_level)
//this.ExpandAll()
End If
End If
End If
End If
End If