You can save the dngshowcursor.prg in
your .\classes directory or in the same directory as
your project.
Just change any of your methods that call
CREATEOBJECT("wwShowCursor") to
CREATEOBJECT("dngShowCursor"). To see the
results of this method Click
Here.
FUNCTION Process
THIS.InitSession()
Session = THIS.oSession
Request = THIS.oRequest
Response = THIS.oResponse
gRowNum=val(Session.GetSessionVar("gROWNUM"))
If empty(gRowNum) && first time through we will set the session variable.
gRowNum = 4 && set your minimum number of rows to display
Session.SetSessionVar("gRowNum",gRowNum)
Endif
DODEFAULT()
RETURN .T.
ENDFUNC
FUNCTION showtable
lnCurrentPage=VAL(Request.QueryString('page'))
lnParam=Request.QueryString('page')
lcorder=upper(Request.QueryString('order'))
lcascend=upper(Request.QueryString('ascend'))
lcRowNum=val((Request.Form("ROWNUM"))) && allows user to change rows on the fly.
If empty(lcorder)
lcorder = 'COMPANY'
Endif
If !lcascend$'ASC,DESC'
lcascend = 'ASC'
Endif
If lnCurrentPage=0
lnCurrentPage=1
Endif
*** Added to give user functionality to change resulting rows in code...
If lcRowNum < 4
lcRowNum = 4 && set your minimum number of rows to display
&& we won't change the global variable since this was a one time.
Else
if lcRowNum <> gRowNum
Session.SetSessionVar("gRowNum",lcRowNum)
gRowNum = lcRowNum
endif
Endif
use wwDevRegistry\wwDevRegistry
SELECT Company, Name as Contact, State, City, Country ;
FROM wwDevRegistry ;
ORDER BY &lcOrder &lcAscend ;
INTO CURSOR TQuery
DIMENSION laHeader[5,2]
laHeader[1,1]='Company'
laHeader[1,2]='right'
laHeader[2,1]='Contact'
laHeader[3,1]='State'
laHeader[3,2]='center'
laHeader[4,1]='City'
laHeader[5,1]='Country'
laHeader[5,2]='Left'
loSC = CREATEOBJECT("dngShowCursor")
loSC.lAlternateRows = .T.
loSC.cExtraTableTags = " style='font:normal normal 8pt tahoma'"
loSC.cHeaderBGColor = "FFCB9C"
loSC.cHeaderColor = "DarkBlue"
loSC.nPage_itemsPerpage = gRowNum
loSc.cPage_PageUrl = "showtable.htx?"
loSC.cValign = "MIDDLE"
loSC.ShowCursor()
lcHTML = loSC.GetOutput()
IF _TALLY = 0
lcHTML = lcHTML + ;
"<p><center><b style='color:darkred'>No entries matched your
search</b></center></p>"
ENDIF
use in wwDevRegistry
this.oResponse.ExpandTemplate('c:\inetpub\wwwroot\sample\showtable.htx')
RETURN
