by ShumingWang » Thu Aug 08, 2013 3:59 am
oCol := obrow1:AddCol()
oCol:bStrData := {||odb1:startdate}
oCol:cHeader := "创建日期"
oCol:cOrder := "A"
oCol:nHeadBmpNo := 1
oCol:bLClickHeader := {|r,c,f,o| ::bas1205( r,c,o) }
...
method bas1205(nrow,ncol,oCol) class bas12class
local aCols,cOrder,nFor,nLen
local nat,id1
aCols := oCol:oBrw:aCols
cOrder := oCol:cOrder
nAt := oCol:nCreationOrder
nLen := LEN(aCols)
for nFor := 1 to nLen
aCols[ nFor ]:nHeadBmpNo := 0
aCols[ nFor ]:cOrder := ""
next
do case
case nAt==1
id1:=::odb1:custid
::odb1:cQuery:="select * from custm1 order by custid"+if(corder=="A"," desc","")
::odb1:refresh()
::obrow:refresh()
::obrow:bseek:={|v|::odb1:SEEK(v,,{||::odb1:custid})}
::obrow:SEEK(id1)
case nAt==3
id1:=::odb1:custm
::odb1:cQuery:="select * from custm1 order by custm"+if(corder=="A"," desc","")
::odb1:refresh()
::obrow:refresh()
::obrow:bseek:={|v|::odb1:SEEK(v,,{||::odb1:custm})}
::obrow:SEEK(id1)
case nAt==5
id1:=::odb1:sales
::odb1:cQuery:="select * from custm1 order by sales"+if(corder=="A"," desc","")
::odb1:refresh()
::obrow:refresh()
::obrow:bseek:={|v|::odb1:SEEK(v,,{||::odb1:sales})}
::obrow:SEEK(id1)
case nAt==6
id1:=::odb1:addrc
::odb1:cQuery:="select * from custm1 order by addrc"+if(corder=="A"," desc","")
::odb1:refresh(.t.)
::obrow:refresh()
::obrow:bseek:={|v|::odb1:SEEK(v,,{||::odb1:addrc})}
::obrow:SEEK(id1)
endcase
if nat==1.or.nat==3.or.nat==5.or.nat==6
if cOrder == "" .or. cOrder == "D"
oCol:cOrder := "A"
oCol:nHeadBmpNo := 1
else
oCol:cOrder := "D"
oCol:nHeadBmpNo := 2
endif
end
return