ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old June 18th, 2004, 11:29 AM
NiceGuyISOYou NiceGuyISOYou is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Pentagon
Posts: 22 NiceGuyISOYou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>&nbsp;</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';


Reply With Quote
  #2  
Old June 19th, 2004, 09:26 AM
jamieB jamieB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2002
Posts: 592 jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 55 m 17 sec
Reputation Power: 17
Quote:
Originally Posted by NiceGuyISOYou

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';



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 )

Reply With Quote
  #3  
Old June 21st, 2004, 08:29 AM
NiceGuyISOYou NiceGuyISOYou is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Pentagon
Posts: 22 NiceGuyISOYou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CF 4-->Oracle-->Table Sort-->JScript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway