hi , I want to add data through jquery ajax but after that the pagination is not working

hi , I want to add data through jquery ajax but after that the pagination is not working

haroonmindharoonmind Posts: 3Questions: 1Answers: 0

hi , I want to add data through jquery ajax but after that the pagination is not working while I am not click to the pagination button all data is show in one table Any one has solution for it

Answers

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    It's mostly likely related to how you are adding the new rows. I'm able to add new rows with out issue and the pagination works fine after adding them.

    Can you provide some inset on how you are adding rows?

  • allanallan Posts: 63,353Questions: 1Answers: 10,444 Site admin

    Agreed, we'd need more information in order to help. If you aren't using the API (row.add() or rows.add()) to add the new rows, then that is where to start.

    Allan

  • haroonmindharoonmind Posts: 3Questions: 1Answers: 0
    edited January 2016

    alright sorry for late reply
    , I am using jquery ajax method on button click and add tbody tr row

     $("#tableBody-orderList ").on('click', '#viewdetail', function () {
                var orderid = $(this).parents('tr').find("#orderNo").html()
                var datas = {orderid: orderid};
                $.ajax(
                    {
                        url: 'Purchase-orders-detail-controller.php',
                        type: 'POST',
                        data: datas,
                        dataType: 'json',
                        success: function (df) {
                            var st = "";
                            var str2 = "";
                            $.each(df, function (index) {
    
                                $.each(df[index], function (key, value) {
    
    
                                
                                        str2 += "<td><input class='field_width' type='text'id='resived_quantity'data-toggle='tooltip' data-placement='top' title='Received Quantity'  placeholder='PaidAmount' aria-describedby='basic-addon1' value='" + value + "' /></td>";
                                    } else if (key == 'left_quantity') {
                                        str2 += "<td id='left_quantity'>" + value + "</td>";
                                    } else if (key == 'detail_id') {
                                        str2 += "<td id='detail_id'>" + value + "</td>";
                                    }                                else if (key == 'quantity') {
                                        str2 += "<td id='quantity'>" + value + "</td>";
                                    } else {
    
                                        str2 += "<td>" + value + "</td>";
                                    }
                                });
    
                                st += "<tr class='rowid'>" + str2 + "<td><button type='button' id='save_detailList'  name='save_detailList' value='save_detailList' class='btn btn-primary'>Save Changes</button></td></tr>";
                                str2 = "";
                            });
                         
                            $("#order-list").html(st);
    
                        }
                        , error: function (jqXHR, textStatus, errorThrown) {
                        alert("  get Price error: " + jqXHR + " TextStatus: " + textStatus + " error: " + errorThrown);
    
                    }
    
                    });
    
    
            });
    

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • haroonmindharoonmind Posts: 3Questions: 1Answers: 0

    no not yet I am using add row api
    so I think that is my answer using by row add api

  • allanallan Posts: 63,353Questions: 1Answers: 10,444 Site admin

    You are correct - see the "append" FAQ on that topic.

    Allan

This discussion has been closed.