Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Not able to focus on a row in table using phonegap technology

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=red;
// e.setAttribute("style", "background-color: red; outline: cyan solid thick;");
}

function unhighlight(e) {
document.getElementById(e).style.background-color=black;
// 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;
}

Please use plain text.
Developer
Hithredin
Posts: 404
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Not able to focus on a row in table using phonegap technology

Please use plain text.