Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

want to add my own loader gif on processing

$
0
0

i want to add the loader when datatbles in processing during search , fileter , and onload

var dtable= $("table#pagination-2").DataTable(
  {
    "language": {
      "processing": "<img src='image-path'>"
    },
    "processing": true,
    "serverSide": true,
    "order": [],
    "ajax": 
    {
      "url": dataTableURL,
      "type": "POST",
    },
    "columnDefs": [
    { 
      "targets": [0],
      "orderable": true
    }],
    'aoColumnDefs': [{
      'bSortable': false,
      'aTargets': [-1,-2,-3] 
    }],
    "initComplete": function() 
    {
      $(".dataTables_filter input")
      .unbind() // Unbind previous default bindings
      .bind("input", function(e) 
      { // Bind our desired behavior
        // If the length is 3 or more characters, or the user pressed ENTER, search
        if(this.value.length > 3) 
        {
          // Call the API search function
          // $(".input-sm").attr('readonly', true);
          dtable.search(this.value).draw();
          //   setTimeout(function() {
          //     $(".input-sm").removeAttr('readonly');
          // }, 2000);
        }
        // Ensure we clear the search if they backspace far enough
        if(this.value == "") 
        {
          dtable.search("").draw();
        }
        return;
      });
    },

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


Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>