<div id="empData">
<table id='empDataTbl' border='1'>
</table>
</div>
JAVAand jQuery code to populate Table
private
String generateEmpDetailsHtml(List<Employee> empData){StringBuilder empDataHtml =
new StringBuilder(); //empDataHtml.append("<table id='empDataTbl' border='1'>");empDataHtml.append(
"<tr>");empDataHtml.append(
"<th> Employee Id</th>");empDataHtml.append(
"<th> First Name</th>");empDataHtml.append(
"<th> Last Name</th>");empDataHtml.append(
"<th> DOB </th>");empDataHtml.append(
"</tr>"); for(Employee emp : empData){empDataHtml.append(
"<TR>");empDataHtml.append(
"<TD>").append(emp.getEmpId()).append("</TD>");empDataHtml.append(
"<TD>").append(emp.getEmpFname()).append("</TD>");empDataHtml.append(
"<TD>").append(emp.getEmpLName()).append("</TD>");empDataHtml.append(
"<TD>").append(emp.getDob()).append("</TD>");empDataHtml.append(
"</TR>");}
//empDataHtml.append("</table>"); return empDataHtml.toString();}
jQuery selector code (I have tried both of them but not worked)
$
('#empDataTbl').find('TR').dblclick(function() {alert(
'Here');$(
this).remove(); return false;});
$
('#empDataTbl TR').dblclick(function() {alert(
'Here');$(
this).remove(); return false;});