jQuery датируемый неизвестный параметр для строки 0, столбца 0 - PullRequest
0 голосов
/ 04 апреля 2020

У меня есть ошибка, которую я не понимаю в моем jQuery данных. У меня есть следующая ошибка

Неизвестный параметр для строки 0, столбца 0

Я не понимаю, почему это происходит - любая помощь будет принята с благодарностью. Спасибо.

Вот мой код контроллера

[CustomAuthorize("extraccion")]
public class extraccionController : Controller
{
    // GET: extraccion
    public ActionResult Indice()
    {
        MetaViewContext metaViewContext = new MetaViewContext();
        return View(metaViewContext.GetMetaView("ext_compras"));
    }

    public ActionResult loadExtraccionTable(string table_name)
    {
        table_name = "ext_compras";
        MetaViewContext metaViewContext = new MetaViewContext();
        var metasViewData = metaViewContext.GetMetaView(table_name).jsonTable;

        return Json(new { data = metasViewData }, JsonRequestBehavior.AllowGet);
    }
}

Вот мой html код

<table id="extracionTable" class="display nowrap" style="width: 100%;">
    <thead>
        <tr>
            @foreach (var item in Model.lstColumns)
            {
            <th>@item.columnName</th>
            }
        </tr>
    </thead>
</table>

Вот код для данных

<script>
$(document).ready(function () {
    var table = $('#extracionTable').DataTable({
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ],
        "ajax": {
        "url": "/extraccion/loadExtraccionTable",
        "type": "GET",
        "datatype": "json",
        },
        rowReorder: {
            selector: 'td:nth-child(2)'
        },
        responsive: true,
        "columns": [
            @foreach (var item in Model.lstColumns)
            {
                <text>
                    { "data":"@(item.columnName)", "autoWidth": true },
                </text>
             }

        ],
    });
});
</script>

Вот часть моего json

[
   {
      "cliente_id":2,
      "nombre_cliente":"my name",
      "direccion":"some adresss",
      "cuidad":"city",
      "departamento":"agricolture",
      "codigo_postal":"444444",
      "pais_nombre":"Colombia",
      "correo_facturacion_electronica":"True",
      "DANE":3,
      "digito_verificacion":4444,
      "NIT":3,
      "plazo_pago":0,
      "comercial_asignado":"some name",
      "con_potencial":1,
      "confirmado":1,
      "eliminado":0,
      "fecha_creacion":"2017-12-22T00:00:00",
      "visitado":1,
      "activo":1,
      "comentario":"Some comment",
      "contacto_id":15,
      "nombre_contacto":"somename",
      "apellido_contacto":"name",
      "carga_contacto":"Sales",
      "correo_contacto":"cliente@email.ca",
      "telefono_fijo_contacto":"444444444",
      "telefono_movil_contacto":"444444444",
      "principal_contacto":1,
      "contacto_eliminado":false
   }
]
...