title: insert data and update the bootstrap data-table pagination not work after refresh
body: <p>I want to refresh this page when someone adds category. But when I refresh a div using ajax then it lost pagination then bootstrap pagination not work and showing all data...but before adding data its pagination work fine. </p>
  
  <pre><code>&lt;table class="table table-bordered datatable dataTable" id="table_export" aria-describedby=""&gt;
      &lt;thead&gt;
          &lt;tr role="row"&gt;
              &lt;th width="80" class="sorting_asc" role="columnheader" tabindex="0" aria-controls="table_export" rowspan="1" colspan="1" aria-sort="ascending" aria-label="roll: activate to sort column descending" style="width: 62px;"&gt;&lt;div&gt;SL&lt;/div&gt;&lt;/th&gt;
              &lt;th width="80" class="sorting" role="columnheader" tabindex="0" aria-controls="table_export" rowspan="1" colspan="1" aria-label="photo: activate to sort column ascending" style="width: 62px;"&gt;&lt;div&gt;Category Name&lt;/div&gt;&lt;/th&gt;
              &lt;th class="sorting" role="columnheader" tabindex="0" aria-controls="table_export" rowspan="1" colspan="1" aria-label="name: activate to sort column ascending" style="width: 255px;"&gt;&lt;div&gt;Status&lt;/div&gt;&lt;/th&gt;
              &lt;th class="span3 sorting" role="columnheader" tabindex="0" aria-controls="table_export" rowspan="1" colspan="1" aria-label="address: activate to sort column ascending" style="width: 235px;"&gt;&lt;div&gt;Action&lt;/div&gt;&lt;/th&gt;
      &lt;/thead&gt;
  
      &lt;tbody role="alert" aria-live="polite" aria-relevant="all"&gt;
          &lt;?php
              $students = $this-&gt;db-&gt;get('brands')-&gt;result_array();
              $i = 0;
              foreach ($students as $row):
                  ?&gt;
                  &lt;tr class="odd"&gt;
                      &lt;td class=" sorting_1"&gt;&lt;?php echo $i += 1 ?&gt;&lt;/td&gt;
                      &lt;td class=" "&gt;&lt;?php echo $row['name']; ?&gt;&lt;/td&gt;
                      &lt;td class=" "&gt;
                          &lt;?php if ($row['status'] == 0) {
                              echo "Un Publish";
                          } elseif ($row['status'] == 1) {
                              echo "Publish";
                          } ?&gt;
                          &lt;/td&gt;
                          &lt;td class=" "&gt;
  
                              &lt;div class="btn-group"&gt;
                                  &lt;button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"&gt;
                                      Action &lt;span class="caret"&gt;&lt;/span&gt;
                                  &lt;/button&gt;
                                  &lt;ul class="dropdown-menu dropdown-default pull-right" role="menu"&gt;
  
                                      &lt;!-- STUDENT EDITING LINK --&gt;
                                      &lt;li&gt;
                                          &lt;a href="#" onclick="showAjaxModal('&lt;?php echo base_url(); ?&gt;modal/popup/modal_brands_edit/&lt;?php echo $row['id']; ?&gt;');"&gt;
                                              &lt;i class="entypo-pencil"&gt;&lt;/i&gt;
                                              edit
                                          &lt;/a&gt;
                                      &lt;/li&gt;
                                      &lt;li class="divider"&gt;&lt;/li&gt;
  
                                      &lt;!-- STUDENT DELETION LINK --&gt;
                                      &lt;li&gt;
                                          &lt;a href="#" onclick="confirm_modal('&lt;?php echo base_url(); ?&gt;Admin/category/delete/&lt;?php echo $row['id']; ?&gt;');"&gt;
                                              &lt;i class="entypo-trash"&gt;&lt;/i&gt;
                                              delete
                                          &lt;/a&gt;
                                      &lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/div&gt;
  
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;?php endforeach; ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;textarea disabled="disabled"&gt;&lt;/textarea&gt;
      &lt;!-----  DATA TABLE EXPORT CONFIGURATIONS -----&gt;
      &lt;script type="text/javascript"&gt;
  
          jQuery(document).ready(function ($) {
  
  
              var datatable = $("#table_export").dataTable({
                  "sPaginationType": "bootstrap",
                  "sDom": "&lt;'row'&lt;'col-xs-3 col-left'l&gt;&lt;'col-xs-9 col-right'&lt;'export-data'T&gt;f&gt;r&gt;t&lt;'row'&lt;'col-xs-3 col-left'i&gt;&lt;'col-xs-9 col-right'p&gt;&gt;",
                  "oTableTools": {
                      "aButtons": [
  
                          {
                              "sExtends": "xls",
                              "mColumns": [0, 1, 2]
                          },
                          {
                              "sExtends": "pdf",
                              "mColumns": [0, 1, 2]
                          },
                          {
                              "sExtends": "print",
                              "fnSetText": "Press 'esc' to return",
                              "fnClick": function (nButton, oConfig) {
                                  datatable.fnSetColumnVis(3, false);
  
                                  this.fnPrint(true, oConfig);
  
                                  window.print();
  
                                  $(window).keyup(function (e) {
                                      if (e.which == 27) {
                                          datatable.fnSetColumnVis(1, true);
                                          datatable.fnSetColumnVis(5, true);
                                      }
                                  });
                              },
  
                          },
                      ]
                  },
  
              });
  
              $(".dataTables_wrapper select").select2({
                  minimumResultsForSearch: -1
              });
          });
  
      &lt;/script&gt;
  </code></pre>
  
  <p>This is my ajax.php</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function (e) {
          $("#addtag").on('submit', (function (e) {
              e.preventDefault();
              $.ajax({
                  url: "&lt;?php echo base_url(); ?&gt;Admin/brands/create",
                  type: "POST",
                  data: new FormData(this),
                  contentType: false,
                  cache: false,
                  processData: false,
                  success: function (data) {
                      $("input[name=name]").val(data);
                      $("div.status select").val("1");
                      $('#table_export').load(document.URL + ' #table_export');
  
  
                      var mytable =
  
                      $('#table_export').DataTable({
                          "paging": true,
                          "lengthChange": false,
                          "searching": false,
                          "ordering": true,
                          "info": true,
                          "autoWidth": false,
                          "sDom": 'lfrtip'
                      });
                      mytable.reload();
                  },
                  done: function (data) {
                  },
                  error: function () {
                  }
              });
          }
          ));
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Before insert value dable show pagination
  <a href="https://i.stack.imgur.com/B3MOf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B3MOf.png" alt="before insert"></a></p>
  
  <p>Here add category
  <a href="https://i.stack.imgur.com/PvmdU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PvmdU.png" alt="add category"></a></p>
  
  <p>after insert value pageination not work and show every value.
  <a href="https://i.stack.imgur.com/eoiqS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eoiqS.png" alt="after table pagination stop work"></a></p>
  
  <p>Total work with no page refresh insert data and also update data-table...</p>