Javascript DataTables警告:表id=示例-请求的未知参数';1';对于第1行第1列

Javascript DataTables警告:表id=示例-请求的未知参数';1';对于第1行第1列,javascript,ajax,datatables,Javascript,Ajax,Datatables,获取错误“DataTables警告:table id=example-请求第1行第1列的未知参数“1”。有关此错误的更多信息,请参阅“从ajax api调用加载数据时,从后端接收的json如下 [{"CustomerName":"Dinesh","product":"23234","perticulars":"wrwer","AddressOfCustomer":"wrew`","ContactNumbers":"jhkjhb"}, {"CustomerName":"dd","product":

获取错误“DataTables警告:table id=example-请求第1行第1列的未知参数“1”。有关此错误的更多信息,请参阅“从ajax api调用加载数据时,从后端接收的json如下

[{"CustomerName":"Dinesh","product":"23234","perticulars":"wrwer","AddressOfCustomer":"wrew`","ContactNumbers":"jhkjhb"}, {"CustomerName":"dd","product":"dfsdfs","perticulars":"fsdfs","AddressOfCustomer":"sdfsdf","ContactNumbers":"fsfsf"}, {"CustomerName":"Pratik","product":"toothbrush","perticulars":"6 inch","AddressOfCustomer":"shreedhama white rose","ContactNumbers":"9949634396"}]
正在填充表数据的HTML div标记的片段如下所示

         <table id="example" class="display" align="center" vertical-align="middle"; cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Customer Name</th>
                <th>Product</th>
                <th>Perticulars</th>
                <th>Address of customer.</th>
                <th>Contact number</th>
            </tr>
        </thead>
        <tbody>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</tbody>
        <tfoot>
            <tr>
                <th>Customer Name</th>
                <th>Product</th>
                <th>Perticulars</th>
                <th>Address of customer.</th>
                <th>Contact number</th>
            </tr>
        </tfoot>
    </table>

您需要有包含对象数组的
数据
对象

{"data": [{"CustomerName":"Dinesh","product":"23234","perticulars":"wrwer","AddressOfCustomer":"wrew`","ContactNumbers":"jhkjhb"}, {"CustomerName":"dd","product":"dfsdfs","perticulars":"fsdfs","AddressOfCustomer":"sdfsdf","ContactNumbers":"fsfsf"}, {"CustomerName":"Pratik","product":"toothbrush","perticulars":"6 inch","AddressOfCustomer":"shreedhama white rose","ContactNumbers":"9949634396"}]}

一个正在工作的

在我的例子中,我只是在代码和错误中更改了以下内容

DataTables警告:表id=bootstrap-data-table2-为第0行请求的未知参数“0”。有关此错误的详细信息,请参阅

他走了:

发件人:

<tbody>
  @foreach (var item in Model.HRMS_Tbl_ExpenseClaimModelList)
    {
      <tr>
        @if (item.Approved == "1")
        {
        <td>@item.Date</td>
        <td>@item.Date</td>
        <td>@item.Type</td>
        <td>@item.Amount</td>
        }
      </tr>
    }
</tbody>
<tbody>
  @foreach (var item in Model.HRMS_Tbl_ExpenseClaimModelList)
    {
    if (item.Approved == "1")
      {
      <tr>
        <td>@item.Date</td>
        <td>@item.Date</td>
        <td>@item.Type</td>
        <td>@item.Amount</td>
      </tr>
      }
    }
</tbody>   

@foreach(模型中的var项目。HRMS_Tbl_ExpenseClaimModelList)
{
@如果(项目批准==“1”)
{
@项目.日期
@项目.日期
@项目.类型
@项目.金额
}
}
至:

<tbody>
  @foreach (var item in Model.HRMS_Tbl_ExpenseClaimModelList)
    {
      <tr>
        @if (item.Approved == "1")
        {
        <td>@item.Date</td>
        <td>@item.Date</td>
        <td>@item.Type</td>
        <td>@item.Amount</td>
        }
      </tr>
    }
</tbody>
<tbody>
  @foreach (var item in Model.HRMS_Tbl_ExpenseClaimModelList)
    {
    if (item.Approved == "1")
      {
      <tr>
        <td>@item.Date</td>
        <td>@item.Date</td>
        <td>@item.Type</td>
        <td>@item.Amount</td>
      </tr>
      }
    }
</tbody>   

@foreach(模型中的var项目。HRMS_Tbl_ExpenseClaimModelList)
{
如果(项目批准==“1”)
{
@项目.日期
@项目.日期
@项目.类型
@项目.金额
}
}

这方面有什么进展吗?