:: Forum >> Version 2 >>

selected rows are highlighted but others rows are also highlighted with grey color...

function findStock(){
var stockName=trim(document.getElementById("stockInput").value);
/*alert('search String: '+stockName);*/
var stock;
var ticker;
var index;
var count=0;
var changeflag=1;
var temp;
for(i = 0; i < top.myRowCount; i++){
if((changeflag%2)==1){
top.screens.stockList.obj.getRowTemplate(i).setStyle("background-color", "#EFEFEF;");
}else{
top.screens.stockList.obj.getRowTemplate(i).setStyle("background-color", "#fff;");
}
if(top.myData[i][2] != '&nbsp;'){
changeflag++;
stock=(trim(top.myData[i][2])).toUpperCase();
index=stock.indexOf(stockName.toUpperCase());
if(index!=-1){
count++;
if(count==1)
temp=i;
top.screens.stockList.obj.getRowTemplate(i).setStyle("background-color", "#FFFFCC;");
top.screens.stockList.obj.getRowTemplate(i).setStyle("color-color", "#000000;");
}
}
if(top.myData[i][0] != '&nbsp;'){
changeflag++;
ticker=(trim(top.myData[i][0])).toUpperCase();
if(ticker.indexOf('>') != -1)
ticker=ticker.substring(ticker.indexOf('>')+1,ticker.indexOf('/')-1);
index=ticker.indexOf(stockName.toUpperCase());
if(index!=-1){
count++;
if(count==1)
temp=i;
top.screens.stockList.obj.getRowTemplate(i).setStyle("background-color", "#FFFFCC;");
top.screens.stockList.obj.getRowTemplate(i).setStyle("color-color", "#000000;");
}
}
top.screens.stockList.obj.getRowTemplate(i).refresh();
}
top.screens.stockList.obj.setCurrentRow(temp).focus();

}
James
Friday, May 9, 2008



This topic is archived.

Back to support forum

Forum search