row().Delete() or Remove() not deleting

row().Delete() or Remove() not deleting

marine88marine88 Posts: 2Questions: 1Answers: 0

I am trying to use Row().Remove() or Delete but seems to not work properly. I need it to reorder after the delete but it seems to not actually delete the item and reorder. Ive included my function. The post to the controller seems to be working find but in addtion I can't get my success: to return true so if I placed my delete call to my controller in there and it would delete but not reorder. Make sense? I chked the page source and I can still the row item and I think its getting confused.
...function deleteRow(taskprocessid) {

        var confirmtext = confirm("Are you sure you want to remove this Task from the Process?");
        if (confirmtext == true) {
            $(document).on("click", "#deleteTaskButton", function() {
                var row = this.closest;
                table.row(row).remove().draw(false);
                deletebyAjax(taskprocessid);

                $.each($('#TasksTable tr td:first-child'), function (index, val) {
                    $(this).html(index + 1)
                });

                table.rows().invalidate();
            });


        } else {
            return;
        }

    }...

Answers

  • allanallan Posts: 62,192Questions: 1Answers: 10,200 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

  • marine88marine88 Posts: 2Questions: 1Answers: 0

    I can't do that if its running against a database?

  • allanallan Posts: 62,192Questions: 1Answers: 10,200 Site admin

    You can PM me a link by clicking my name above and then "Send message".

    Unfortunately I need more information to understand the issue and the best way of getting that is to be able to see the page and thus the full client-side code.

    I don't see from the above why it isn't working. Does it make an Ajax request to the server on delete? If so, what does the server return? Does it actually do the delete on the database, but the client-side just doesn't update?

    Allan

This discussion has been closed.