|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CF 4-->Oracle-->Table Sort-->JScript
Experience: CF 4=3 days, JScript=6 mo., Programming=30 yrs.
I'm modifying a Cold Fusion 4.0 web page which displays Oracle data in 4 columns with one column containing either a .GIF or a background color based on a value in another column. I pasted in a solution from here, in JScript to allow dynamic resorting of the rows based upon a user clicking a header column. I'm attempting to reset the 'visual' column to either a .GIF image or background color based on the value contained in another column. I've seen references to objects and methods unknown to me, i.e. "div" and "getElementById". The table row's 'visual' value is populated using this CF code: <CFIF #BVer# is "New"> <CFIF #Status# is 1> <TD align=center id="dynamicBG" bgcolor=##FF0000><SMALL> </SMALL></TD> </CFIF> <CFELSE> <CFIF #Status# is 1><TD id="dynamicIMG"><IMG SRC="red.gif" WIDTH=40 HEIGHT=20></TD> </CFIF </CFIF> Is this line equivalent to the usage of the "bgcolor" in the original row definiton? document.getElementById( 'dynamicBG' ).style.backgroundColor = '#ff992c'; Is this line equivalent to the usage of the IMG SRC in the original row definiton? document.getElementById( 'dynamicIMG' ).SRC = 'blue.gif'; ![]() |
|
#2
|
|||
|
|||
|
Quote:
document.getElementById( 'dynamicIMG' ) returns the TD element that contains the img (which is why it makes sense to set its background colour), not the img itself, so you can't set it's SRC. To do that you would need to assign an id to the img tag and use that instead. Other than that I'm not really sure what you're asking & that code looks like it should work...? (Despite the redundant pound signs...<CFIF BVer is "New"> will work fine ) |
|
#3
|
|||
|
|||
|
Thanks. I was just wondering whether the getElementById properties would have the same desired outcome as the original TD statements. As a continuation of this logic, if the table has been resorted after the initial TD were executed, would the tags still point to the correct item?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CF 4-->Oracle-->Table Sort-->JScript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|