我无法从动态创建的div列表中获取id。 div由Web服务填充。
div的列表:( pendRefNo是参考编号,用作div的id)
strPendList += '<div id="workqList_'+pendRefNo+'" class="
pendClaimDisplay" x-blackberry-focusable="true" onmouseover="refHighlight(this)"
onmouseout="noRefHighlight(this)" onclick="qClaimDetails(\''+pendRefNo+'\')">';
strPendList += '<div class="pendRefLabel">REF NO </div>';
strPendList += '<div class="pendRefValue">: '+pendRefNo+'</div>';
strPendList += '<div class="pendRequesterLabel">REQUESTER : </div>';
strPendList += '<div class="pendRequesterValue">'+pendEmpNo+' '+pendRequester+'</div>';
//strPendList += '<div class="pendRequesterValue">'+pendRequester+'</div>';
strPendList += '<div class="pendDateLabel">DATE </div>';
strPendList += '<div class="pendDateValue">: '+pendDate+'</div>';
strPendList += '<div class="pendAmountLabel">AMT : </div>';
strPendList += '<div class="pendAmountValue">'+pendAmount+'</div>';
strPendList += '</div>';//end of pendClaimDisplay
当scoll时,突出显示特定div和div,然后用户单击Blackberry菜单键,然后从菜单中选择Approve:
function bbMyWorkQ()
{
blackberry.ui.menu.clearMenuItems();
var topDivider = new blackberry.ui.menu.MenuItem(true, 1);
blackberry.ui.menu.addMenuItem(topDivider);
var itemApprove = new blackberry.ui.menu.MenuItem(false, 2, "Approve", approveCheck);
blackberry.ui.menu.addMenuItem(itemApprove);
var itemReject = new blackberry.ui.menu.MenuItem(false, 3, "Reject", rejectCheck);
blackberry.ui.menu.addMenuItem(itemReject);
}
它会调用函数:
function approveCheck()
{
$('.pendClaimDisplay').mouseover(function() {
alert($(this).attr('id'));
});
}
该函数应返回突出显示的div的id,但仅当我向下滚动列表以选择另一个div时它才有效。只有当用户从Blackberry菜单键中选择Approve(approveCheck)时才会触发该功能。但是,如果我向下滚动列表,该函数将在第一次被调用后继续被调用。
有人可以帮忙吗?
谢谢。