data listing related div/table refresh problem
i have this code
$.ajax({
type: "POST",
url: "<?=base_url()?>users/register",
data: $("#register_form").serialize(),
success: function(html){
$( "#users tbody" ).after(html);
},
error: function(){
alert('Error');
}
});
this works fine. it appends the new row at end of table listing. now here is the html and php code
<tbody>
<?
foreach ($table_resultset->result() as $row)
{
?>
<tr>
<td><? echo $row->user_first_name; ?></td>
<td><? echo $row->user_last_name; ?></td>
<td><? echo $row->user_profile; ?></td>
<td><? echo $row->user_email; ?></td><!--<?=site_url()?>users/delete_user/<?// echo $row->user_id; ?>-->
<td width="18%"><div align="right"><a href="#." style="cursor:pointer;">Edit</a> | <a href="#." name="del_user_id" id="<? echo $row->user_id; ?>" class="delete-user">Delete</a></div></td>
</tr>
<?
}
?>
</tbody>
scenario: when i load this page the delete event is working fine. the issue come when i add a new row using jquery dialogs. after the inserting of new row the click event for that particular record didn't make work.
here is the code of php file where i snd the post using ajax get back the html code.
$html .='<tr>';
$html .='<td>'.$row->user_first_name.'</td>';
$html .='<td>'.$row->user_last_name.'</td>';
$html .='<td>'.$row->user_profile.'</td>';
$html .='<td>'.$row->user_email.'</td>';
$html .='<td width="18%"><div align="right"><a href="#." style="cursor:pointer;">Edit</a> | <a href="#." class="delete-user" name="del_user_id" id="'.$row->user_id.'">Delete</a></div></td>';
$html .='</tr>';
}
echo $html;
please help me with this.