jquery deleting a table row help
<p>I have some code like this to delete a row then display a dialog.</p>

<p>the first time i click delete id removes the row straight away.
but on any subsequent rows i try to delete i sometimes need multiple clicks before it removes the row.</p>

<p>sometimes the dialog shows and the row is still there!</p>

<p>what is the matter?</p>

<p>EDIT - The db gets updated correctly but the row still remains. its quite erratic sometimes it removes sometimes i have to click twice.</p>

<pre><code>$(".delete-item").click(function () {
            var itemId = $(this).attr("id").split('-')[1];
            var iType = $(this).attr("id").split('-')[0];

            $.post('/User/Delete/', { id: itemId, itemType: iType },function (json) {
                if (json.success) {

                    console.log("#row-"+itemId);
                    $("#row-"+itemId).hide('slow', function(){ $(this).remove(); });

                    //$("#dialog-success-delete").dialog("open");


                } else {
                    if(json.error=="unknown"){
                        $("#dialog-unknown-error").dialog("open");
                    }
                    if(json.error=="unauthenticated"){
                        $("#dialog-unauthenticated").dialog("open");
                    }
                }
            });
</code></pre>
