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

Unknown Parameter Error for row 4, column 1 error.

$
0
0

Hello, I was hoping someone could help me with an error I'm having with my code. I keep getting an "Unknown Parameter Error for row 4, column 1 error". It's weird because I get the pop-up error, but my table still loads with all of the data.

Javascript:

$(document).ready(function() {
    var table = $('#example').DataTable( {
         "ajax": {
            "url": "roster.json",
            // "dataType": "jsonp",
            "dataSrc": "SiteKit.Roster",
        },
        "columns": [
            {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": ''
            },
            { "data": "name" },
            { "data": "height" },
            { "data": "weight" },
            { "data": "birthdate" },
            { "data": "birthtown" },
        ],
        "order": [[1, 'asc']]
    } );
     
    // Add event listener for opening and closing details
    $('#example tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );
 
        if ( row.child.isShown() ) {
            // This row is already open - close it
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            // Open this row
            row.child( format(row.data()) ).show();
            tr.addClass('shown');
        }
    } );
} );

Json:

{
"SiteKit":{
"Parameters":{
"feed":"modulekit",
"view":"roster",
"key":"xxx",
"fmt":"json",
"client_code":"123",
"lang":"en",
"season_id":60,
"team_id":"123",
"lang_id":1,
"league_id":"4"
},
"Roster":[
{
"id":"5512",
"birthtown":"Toronto, Ontario",
"height":"5-11",
"weight":"196",
"birthdate":"1991-06-25",
"tp_jersey_number":"2",
"draftinfo":[
],
"name":"Test Name 1",
"player_image":"http://via.placeholder.com/350x150"
},
{
"id":"5512",
"birthtown":"Winnipeg, Manitoba",
"height":"5-11",
"weight":"196",
"birthdate":"1991-06-25",
"tp_jersey_number":"2",
"draftinfo":[
],
"name":"Test Name 2",
"player_image":"http://via.placeholder.com/350x150"
},
{
"id":"5512",
"birthtown":"Calgary, Alberta",
"height":"5-11",
"weight":"196",
"birthdate":"1991-06-25",
"tp_jersey_number":"2",
"draftinfo":[
],
"name":"Test Name 3",
"player_image":"http://via.placeholder.com/350x150"
},
{
"id":"5512",
"birthtown":"Edmonton, Alberta",
"height":"5-11",
"weight":"196",
"birthdate":"1991-06-25",
"tp_jersey_number":"2",
"draftinfo":[
],
"name":"Test Name 4",
"player_image":"http://via.placeholder.com/350x150"
},
[
{
"name":"Coach Name 1",
"coach_id":"313",
"role_id":"5",
"role":"General Manager",
"hometown":"",
"homeprov":"",
"jersey_number":"0",
"start_date":"2018-04-19",
"end_date":"2018-06-17",
"is_admin":"0"
},
{
"name":"Coach Name 2",
"coach_id":"313",
"role_id":"5",
"role":"General Manager",
"hometown":"",
"homeprov":"",
"jersey_number":"0",
"start_date":"2018-04-19",
"end_date":"2018-06-17",
"is_admin":"0"
},
{
"name":"Coach Name 3",
"coach_id":"313",
"role_id":"5",
"role":"General Manager",
"hometown":"",
"homeprov":"",
"jersey_number":"0",
"start_date":"2018-04-19",
"end_date":"2018-06-17",
"is_admin":"0"
},
{
"name":"Coach Name 4",
"coach_id":"313",
"role_id":"5",
"role":"General Manager",
"hometown":"",
"homeprov":"",
"jersey_number":"0",
"start_date":"2018-04-19",
"end_date":"2018-06-17",
"is_admin":"0"
}
]
]
}
}

HTML:

<table id="example" class="display" style="width:100%">
<thead>
    <tr>
        <th></th>
        <th>Name</th>
        <th>Height</th>
        <th>Weight</th>
        <th>DOB</th>
        <th>Birthplace</th>
    </tr>
</thead>
</table>

Viewing all articles
Browse latest Browse all 82778

Trending Articles



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