3.2.0

plz give me solution..urgent...

when i search a text then those rows having that text is highlighted with yellow color...bt other rows are also getting greay color...giving the coding plz tellme wht to do???



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
May 9,
try removing the else part from first if
varunika
May 30,

This topic is archived.

See also:


Back to support forum