Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Please find attached the application picture, where the column ORDER ID is not showing, and instead of that, is showing the PLUS sign. So all the columns should shift for one to the right.

ajax And all the time when I run the application it shows me this error message:

DataTables warning (table id = 'companies'): Added data (size 3) does not match known number of columns (4)



var oTable;
    $('#companies tbody td img').live('click', function () {
    var nTr = this.parentNode.parentNode;
    if (this.src.match('details_close')) {
    /* This row is already open - close it */
    this.src = "/Content/images/details_open.png";
    oTable.fnClose(nTr);
    }
    else {
    /* Open this row */
    this.src = "/Content/images/details_close.png";
    var orderid = $(this).attr("rel");
    $.get("Me?OrderID=" + orderid, function (detalet) {
    oTable.fnOpen(nTr, detalet, 'details');
    });
    }
    });

    /* Initialize table and make first column non-sortable*/
    oTable = $('#companies').dataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": 'AjaxHandler',
    "bJQueryUI": true,
    "aoColumns":
     [
    { "bSortable": false, 
    "bSearchable": false,
    "fnRender": function (oObj)
     {
    return '<img src="/Content/images/details_open.png" alt="expand/collapse" rel="' + oObj.aData[0] + '" />';
    }
    },
    null,
    null,
    null
    ]
    });





<table id="companies" class="display">
        <thead>
            <tr>
                <th> </th>
                <th>Order  ID</th>


                <th>Customer ID</th>
              
                <th>Ship Address</th>
        
            </tr>
        </thead>
        <tbody></tbody>
    </table>
 Run code snippet





the first column of the table should be the image img , then is order id , then is customer id , then is ship address .thats it.


What I have tried:

i just explained the problem above
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900