Display data to server side table dynamically.

Display data to server side table dynamically.

inquisitive_sthainquisitive_stha Posts: 7Questions: 6Answers: 0
edited April 2018 in Free community support

I have already created server-side data statically, also dynamic data is successfully fetched. But, I have no idea on displaying them.

Code

    $('#voterDataTable').DataTable( {
        "processing": true,
        "serverSide": true,

        "ajax": {
            "url":base_path +'/admin/v/listVoter',
            "dataType":"json",
            "type":"POST",
            "data":{"_token":csrf_token}
        },
        "columns":[
        {"data":"1"},
        {"data":"53"},
        {"data":"74"},
        {"data":"78","searchable":false,"orderable":false}
        ]
    } );

All I need is,

        {"data":"1"},
        {"data":"53"},
        {"data":"74"},
        {"data":"78","searchable":false,"orderable":false}

this section need to looped. i.e. I want to be something like

        {"data":"0"},
        {"data":"1"},
        {"data":"2"} 
        {"data":"78","searchable":false,"orderable":false}

How can I achieve this, any suggestion will be appreciated.

Answers

This discussion has been closed.