want to add my own loader gif on processing

want to add my own loader gif on processing

elevensquareelevensquare Posts: 5Questions: 2Answers: 0
edited February 2020 in Free community support

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.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

This discussion has been closed.