08-04-2012 09:42 PM
Hi i want show some data in list.list is scrollable . but i am not able to focus on row of table.but when i am not using for loop , simply added on page using ( onmouseover=\"highlight(this);\" onmouseout=\"unhighlight(this);\" )this.it works fine focus will come. but when i added to for loop then focus will come on first row.can you suggest how to focus .any example please share.
function highlight(e) {
alert(e);
document.getElementById(e).style.background-color=
// e.setAttribute("style", "background-color: red; outline: cyan solid thick;");
}
function unhighlight(e) {
document.getElementById(e).style.background-color=
// e.setAttribute("style", "");
}
function GetDepartureStationDashboard_callBack()
{
var tabledata = "";
tabledata += "<table x-blackberry-focusable=\"true\">";
for (var i = 0; i < 20; i++)
{
tabledata += "<tr x-blackberry-focusable=\"true\" onmouseover=\"highlight(i);\" onmouseout=\"unhighlight(i);\" id=\"i\" x-blackberry-onUp=\"scroll(50)\" x-blackberry-onDown=\"scroll(50)\">";
tabledata += "<td width=\"30%\">" + i + "</td>";
tabledata += "<td width=\"30%\">" + i+ " - " + i+56 + "</td>";
tabledata += "<td width=\"35%\">" + i+56 + " (" + i+6 + ")" + "</td>";
tabledata += "</tr>";
}
tabledata += "</table>";
document.getElementById("mainBodyDiv").innerHTML = tabledata;
}
08-06-2012 09:25 AM