Don Oldenburg
|
| Posted: 08/10/2001, 9:17 AM |
|
Hey guys,
I stumbled through the editable grid issue for a while, and bound and
determined NOT to get technical support involved again (I think they are
getting sick of me) I muttled through the issues. First of all -- the
example given to use by CC is functional -- however if you start building
grids with lots of fields, it will easily become very confusing to keep
track of the field names. And trying to act on the accordingly can be very
difficult. I'm no ASP Genius--But I know there are others out there who
struggle with some of this ASP logic besides me. SO, here is my findings
for multiple fields in an updateable grid. Take it for what its worth--but
I think it's easy to follow, and makes it easy to perform actions on
multiple fields easily. IMHO... Good luck, and hopes this atleast helps
out one person! I had some debugging options to display variables in
here -- they are now commented out. But I'd suggest uncommenting them if
you are trying to debug.
Don
FORM BEFORE SHOW EVENT
========================
flddelivered="<input type=checkbox name=" & fldrtatrans_id & "CHEK >"
fldvoucherdesc="<input type=text name=" & fldrtatrans_id & "TEXT >"
PAGE EVENT OPEN
================
for each i in Request.QueryString
id = i
idvalue = request.querystring(i)
idlen = len(id)-4
idrec = left(id,idlen)
if isempty(id) then exit for
'response.write(" --id=" & id)
'response.write(" --idvalue=" & idvalue)
'response.write(" --idlen=" & idlen)
'response.write(" --idrec=" & idrec)
if right(id,4)="TEXT" then
if idvalue<> "" then
'response.write(" ***Updated Voucher Desc*** ")
cn.execute("update rtaTrans set voucherdesc='" & idvalue & "'
Where rtatrans_id=" & idrec )
end if
end if
if right(id,4)="CHEK" then
if idvalue="on" then idvalue="1"
'response.write(" ***Updated delivered*** ")
cn.execute("update rtaTrans set delivered=" & idvalue & " Where
rtatrans_id=" & idrec )
cn.execute("update rtaTrans set deliverdate=" & date() & " Where
rtatrans_id=" & idrec )
end if
next
|
|
|
 |
|