On 6/4/07, Lee Hinde <[EMAIL PROTECTED]> wrote:
On 6/4/07, infosoft <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I have a table where I browse the records of the database. I
> implemented a delete button in each row. When I press this button, I
> send an ajax request to the server. If the response is ok, I need to
> delete the row of the table that have the data I was deleted.
>
> By example:
>
> HTML Code:
> =========
>
> <table id="explorer">
> <tr id="row-1">
> <td>News title</td>
> <td><a href="javascript:deleteRow(1, "row-1">Delete</a></td>
> </tr>
> [...]
> <tr id="row-10">
> <td>News title</td>
> <td><a href="javascript:deleteRow(10, "row-10">Delete</a></td>
> </tr>
> </table>
>
> Javascript Code:
> ===========
>
> function deleteRow(iId, sRowId)
> {
> jqRow = $("#" + sRowId);
> /* Change de color of row */
> jqRow.addClass("todelete");
> if (window.confirm("¿Desea borrar esta noticia?"))
> {
> /* Change de color again */
> jqRow.removeClass("todelete");
> jqRow.addClass("deleting");
>
> if (AJAX_RESPONSE_OK)
> {
> jqRow.fadeOut("slow", function()
> {
> jqRow.remove();
> window.alert("Record delete");
> });
> }
> }
> }
>
> When the code is executed, in the table appears an empty space instead
> of the row. If I not use the fadeOut effect, the row disappears
> correctly.
>
> Could you Help me?
>
> Thanks in advance
>
> Pablo
>
>
Hi; the sample html provided has typos. I cleaned it up and ran it in
FireFox and Safari and the row disappeared.
<table id="explorer">
<tr id="row-1">
<td>News title</td>
<td><a href="javascript:deleteRow(1,'row-1')">Delete</a></td>
</tr>
<tr id="row-10">
<td>News title</td>
<td><a href="javascript:deleteRow(10,'row-10')">Delete</a></td>
</tr>
</table>
I inserted a couple more rows and am seeing the problem in Firefox
now; in Safari it seems to close the gap about 90% of the way.