When I delete data from jquery data-table it still showing in grid until refresh

0 votes

I tried that table automatically refresh but it does not until I manually reload the whole page.

When I delete data this exception occur in console on .draw();

Uncaught TypeError: $(...).draw is not a function at sortTableAfterdelete

function ConfirmDelteTraining(id) {

        $.post("/Franchise/deleteTraining", { TrainingId: id }, function (data) {

            if (data) {
                debugger;
                var t = $('#trainingGrid').DataTable();
                t.row($('#trainingGrid').find('[data-id=' + id + ']')).remove().draw();

                //Set order after deleting state
                sortTableAfterdelete();
         }

 function sortTableAfterdelete() {

        if ($("#trainingGrid tbody tr td").length == 1) {

            $('#trainingGrid').DataTable().search(this.value).draw();

        }
    };

Aug 19 in Web Development by gaurav
• 18,960 points
20 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
0 answers

@edureka! in my nodejs as its i have used it and pug also but my css doesn't worked as while running localhost it doesn't show styling of css

<!DOCTYPE html><html></html><head><style></style>@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); *{ margin: 0; box-sizing: border-box; padding: 0; } #navbar{ background-color:black; padding: 18px ...READ MORE

Jun 11, 2020 in Web Development by anonymous
• 120 points
330 views
0 votes
1 answer

Using Jquery Ajax to retrieve data from Mysql

Perform a AJAX GET request to get ...READ MORE

answered Jun 23 in Web Development by rajatha
• 7,440 points
1,119 views
0 votes
1 answer

Loading gif in jQuery ajax call is not showing

Create a div with your image. Make it ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,440 points
201 views
0 votes
0 answers

JQuery $.ajax() post - data in a java servlet

I want to send data to a ...READ MORE

Jun 29 in Web Development by gaurav
• 18,960 points
298 views
0 votes
1 answer
0 votes
1 answer

datatable remove column on export to pdf and excel

When we are using jquery datatable for ...READ MORE

answered Feb 17 in Others by gaurav
• 18,960 points
1,408 views
0 votes
1 answer

TypeError: $(...).DataTable is not a function

This happened because the jQuery DataTables library ...READ MORE

answered Apr 30 in Git & GitHub by narikkadan
• 20,880 points
1,096 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,890 points
236 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP