i am getting empty Rows on search, but the no of rows are correct...

i am getting empty Rows on search, but the no of rows are correct...

jay balujay balu Posts: 4Questions: 1Answers: 0
edited November 2018 in Free community support

hi,

please go to this url "precisionaerocomponents.com/precision_aero/index.php" and search with "01" on "Part Number" input box, you will get about "727 " matching rows but the values are empty, but the data base has the values

please help me in this, below is the function i am using.

function searchDataTable(){

  var part_number = $('#part_number').val();

  var description = $('#description').val();

  var manufacture = $('#manufacture').val();

 $('#capabilities').removeClass('hide');

  $('#capabilities').dataTable().fnDestroy();

  $('#capabilities').DataTable({

        iDisplayLength: 15,  

        bProcessing: true,

        bServerSide: true,

        searching: false,

        language: {

        "zeroRecords": "<center style='color:red;'>Sorry, no results found based on your search criteria</center>"

        },

        sAjaxSource: "<?php echo base_url() ?>account/signin/getCapabilities",

         "fnServerParams": function (aoData) {

         aoData.push( { "name": "part_number", "value": part_number});

         aoData.push( { "name": "description", "value": description});

         aoData.push( { "name": "manufacture", "value": manufacture});

       },

        aLengthMenu: [

          [15, 20, 25, 50, 100, -1],

          [15, 20, 25, 50, 100, "All"] // change per page values here

        ],

        aoColumns: [         

          null, 

          null, 

          null, 

        ]



});



 }

Answers

  • jay balujay balu Posts: 4Questions: 1Answers: 0
    edited November 2018

    Please let me know what was going wrong

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Take a look at the Network tab of the Browser's developer tools. You will see these parameters sent in the search request:

    sEcho: 1
    iColumns: 3
    sColumns: ,,
    iDisplayStart: 0
    iDisplayLength: 15
    mDataProp_0: 0
    bSortable_0: true
    mDataProp_1: 1
    bSortable_1: true
    mDataProp_2: 2
    bSortable_2: true
    iSortCol_0: 0
    sSortDir_0: asc
    iSortingCols: 1
    part_number: 01
    description: 
    manufacture: 
    _: 1543501671427
    

    The response status code is 200 but there is no response data. The problem seems to be in your server script. I would start debugging there to see why its not returning data.

    Kevin

  • jay balujay balu Posts: 4Questions: 1Answers: 0

    please have a look at the attached file.. status code is 200 as you said

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    edited November 2018

    Correct, but there is no response data.

    Again you need to debug your server script to see why its not returning data.

    Kevin

  • jay balujay balu Posts: 4Questions: 1Answers: 0
    edited November 2018


    i can see the response its all null

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

    Hi @jay balu ,

    If the server is sending back those null values, then I would suggest debugging that server side script. It's obviously reading the table OK, since the row count is correct, but there's going to be something wrong in that script in how it packages up that data.

    Cheers,

    Colin

This discussion has been closed.