IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Lotus Sandbox

Lotus Sandbox

developerWorks
User Review of Alternate Color Rows View in a Web Browser - New Version
Submitted by Reggie Atwood on 11/07/2003.
Comment
I can't get this to work in domino 6.0.2 Here is my alternateColor code. Can anyone see anything wrong? The rows are not alternating colors.
function alternateColor(resulting)
{
if ( resulting.toUpperCase().split('<P><H2>NO DOCUMENTS FOUND</H2>')[0] == '' )
{
actualResult = '<table width="100%"><tr><td class="oddline"><b>Data Not Found</b></td></tr></table>';
return (actualResult);
}
resulting=resulting.replace(/\r|\n|\r\n/g,"")
resultArr=resulting.replace(/<td/gi,"<TD")
resultArr=resultArr.replace(/<tr/gi,"<TR")
resultArr=resulting.replace(/<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR VALIGN=top>/gi,"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><~TR VALIGN=top>")
resultArr=resultArr.split('<table border="0" cellpadding="2" cellspacing="0">')
resulting = '<TABLE CELLSPACING="0" BORDER="0" CELLPADDING="4" WIDTH="100%">'+resultArr[1]
resultArr=resulting.split('<TR');
assignValue = "<TR class=oddline"
for ( i=0;i < resultArr.length ;i++)
{
if ( i==0)
{
actualResult=resultArr[i];
}
else
{
actualResult += ( assignValue + resultArr[i] );
if ( assignValue == "<TR class=evenline")
{
assignValue = "<TR class=oddline"
}
else
{
assignValue = "<TR class=evenline"
}
}
}
actualResult=actualResult.replace(/<TH NOWRAP/gi,"<TH class=formheader")
actualResult=actualResult.replace(/<TH>/gi,"<TH class=formheader>&nbsp;")
actualResult=actualResult.replace(/<TD>/gi,"<TD>&nbsp;")
actualResult=actualResult.replace(/NOWRAP/gi,"")
actualResult=actualResult.replace(/<~TR/gi,"<TR")
return (actualResult);
}

Go back

Lotus Software

Document options
Print view

  Sandbox views
By Application Name
By Category
By Product
By Audience
By Date
By Submitter
Conferences

  Resources
developerWorks: Lotus Downloads
alphaWorks Downloads
    About IBM Privacy Contact