I have inherited code with a TDC control. In this file, there are two
javascripts of interest. One of these is a function, filter(), which is
inside
<script language=javasc ript></script>.
The other is code inside
<script language=javasc ript FOR=inquiry
event=ondataset complete()></script>
where inquiry is the TDC.
The table displays correctly. The problem is in getting the total after
doing a display and then refreshing the TDC (which invokes the script
filter() ). That calculation is done in the second script. What
happens in there is:
var rs = inquiry.records et;
extcosttot = 0;
num = rs.Fields.Count ;
while(rs.EOF != true)
{
extcosttot += parseFloat(rs(9 ).value);
rs.moveNext;
}
When I alert inside the while loop, the very first record from before
the sorting -- even though the table display properly with the new one.
I tried to put similar looping code at the end of filter() to examine
what I get from the TDC refresh, but I got a messages of "Operation is
not allowed when the object is closed". When I added an open() for I
got "The connection cannot be used to perform this operation. It is
either closed or invalid in this context".
I am at a bit of a loss. I have no idea what happens between the end of
filter() and the inline script and I have no idea on how to
successfully put in code to see what is at the end of filter().
Since there is no code in the generator file for how the sorting is
taking place, the problem must be after retrieving the recordset,
observing somehow that it was left at a certain column being sorted, and
then sorting it accordingly.
javascripts of interest. One of these is a function, filter(), which is
inside
<script language=javasc ript></script>.
The other is code inside
<script language=javasc ript FOR=inquiry
event=ondataset complete()></script>
where inquiry is the TDC.
The table displays correctly. The problem is in getting the total after
doing a display and then refreshing the TDC (which invokes the script
filter() ). That calculation is done in the second script. What
happens in there is:
var rs = inquiry.records et;
extcosttot = 0;
num = rs.Fields.Count ;
while(rs.EOF != true)
{
extcosttot += parseFloat(rs(9 ).value);
rs.moveNext;
}
When I alert inside the while loop, the very first record from before
the sorting -- even though the table display properly with the new one.
I tried to put similar looping code at the end of filter() to examine
what I get from the TDC refresh, but I got a messages of "Operation is
not allowed when the object is closed". When I added an open() for I
got "The connection cannot be used to perform this operation. It is
either closed or invalid in this context".
I am at a bit of a loss. I have no idea what happens between the end of
filter() and the inline script and I have no idea on how to
successfully put in code to see what is at the end of filter().
Since there is no code in the generator file for how the sorting is
taking place, the problem must be after retrieving the recordset,
observing somehow that it was left at a certain column being sorted, and
then sorting it accordingly.
Comment