Server side not fount in my table

Server side not fount in my table

emmanuel921218emmanuel921218 Posts: 11Questions: 4Answers: 0

I need your help to see why the server side option does not work in my table, when I set it to true it shows all the data without pagination.

var genealogytable = $('#arbol').DataTable({
  "bProcessing": true,
  "bServerSide": true,
  destroy: true,
  scrollX: true,
  scrollCollapse: true,
  paging: true,
  aaSorting: [],
  ajax: { 
    url: "arbol",
    type: "get", 
    datatype: "json", 
    data: {
        _token:$('#_token').val(),
      idsponsor: idsponsor,
      period: period,
      typee: typee,
    },
  },
  columns: [ 
    { 
      data: null,
      'render': function (data, type, row){
        if(row.Distributor_status == 'D'){
          if(row.OnWatchList  == 'YES'){
            return '<a href="javascript:void(0)" onclick="deleteRowGen(this.parentNode.parentNode.id)">' +'<img src="img/delete.png" width="30px"/>'+'</a>';
          }else{
            return '<a href="javascript:void(0)" onclick="addRowGen(this.parentNode.parentNode.id)">'+'<img src="img/add2.png" width="30px"/>' + '</a>';
          }
        }else{
          return '';
        }
      }
    },   
    {  
      data: null,
      'targets': 0,
      'searchable':false,
      'orderable':false,
      'className': 'dt-body-center',
      'render': function (data, type, row){
          return '<td> <p><label> <input type="checkbox" id="emailGenealog[]" name="email[]" class="check_mailGenealogy" onclick="mailRowGen(this.parentNode.parentNode.parentNode.parentNode.id)" value="'+row.email+'" /><span></span></label></p> </td>';
      }
      //defaultContent: '<td> <p><label> <input type="checkbox" id="emailGenealog[]" name="email[]" class="check_mailGenealogy" onclick="mailRowGen(this.parentNode.parentNode.parentNode.parentNode.id)" name="" value="" /><span></span></label></p> </td>'
    },
    {data: 'Line'},//1
    {data: 'Level'},//2
    {data: 'associateid'},//3
    {data: 'associatename'},//4
    {data: 'Distributor_status',//5
      "render": function (data, type, row) {
        if (row.Distributor_status == 'D') {
            return 'Consultant';
        }else if (row.Distributor_status == 'C') {
            return 'Customer';
        }else if (row.Distributor_status == 'H') {
            return 'Non Renewed';
        }else if (row.Distributor_status == 'S') {
            return 'suspended';
        }else{
          return row.Distributor_status;
        }
      }
    },
    //{data: 'email'},//6
    { 
        data: null,
        "render": function(data, type, row){
            var email = row.email;
            return "<a href = 'mailto: " + email.trim() + "' title='Send Email'>" + email.trim() + "</a>";
        }
    },
    {data: 'mobile_number'},//7
    {data: 'alternative_number'},//8
    {data: 'country'},//9
    {data: 'State_ID'},//10
    {data: 'PinRank'},//11
    {data: 'PayRank'},//12
    {data: 'InactiveMonths'},//13
    {data: 'RenewalDate', type:"text"},//14
    {data: 'SignupDate', type:"date"},//15

});

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited April 2021

    Try using serverSide, note capitalisation. If that doesn't work, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.