0

Update table after success AJAX in Magento 1.x.

I want update table after success AJAX. I can update it, but it work wrong for me.

I have a pagination of custom table. When i click number, it load and update table but all data checked in first page not save. I need it save all data checked after submit.

Ex :

Page 1: Checked 5

Page 2: Checked 2

When click page 1. It not checked. Please help me.

My Table :

enter image description here

My Jquery

jQuery(document).ready(function() {
    jQuery(".pages li a").each(function() {
        jQuery(this).removeClass('pageLinks').addClass('pageLinks');
    });

    jQuery(".pageLinks").click(function(e) {
        jQuery("body").addClass("loading");
        e.preventDefault();
        var anchorSel = jQuery(this).attr('href');
        // console.log(anchorSel);
        jQuery.ajax({
            type: "POST",
            datatype: "HTML",
            cache: true,
            url: anchorSel,
            success: function(data) {
                jQuery("body").removeClass("loading");
                var testdata = jQuery(data).find("#table-returns-of-product");
                jQuery(".col-main #table-returns-of-product").html(testdata);
            },

            complete: function(data) {
                jQuery(".pages li a").each(function() {
                    jQuery(this).removeClass('pageLinks').addClass('pageLinks');
                });
            }
        });
    });
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.