DataTables warning: table id=data-table-simple - Requested unknown

DataTables warning: table id=data-table-simple - Requested unknown

jfabianjfabian Posts: 13Questions: 3Answers: 0
edited April 2018 in Buttons


I only need to know how to avoid this alert or destroy it. This happens when I create a new row with the create button.

var editor = new $.fn.dataTable.Editor( {
    table: "#data-table-simple",
    fields: [ {
            label: "Vendedor:",
            name: "Vendedor"
        }
      ]
    });
$('#data-table-simple').DataTable( {
      select: 'single',
      dom: "Bfrtip",
      columns: [
          { data: "Vendedor" },
          { data: "Ver" },
          { data: "Eliminar" },
          { data: "Activar o desactivar" }
      ],
      order: [
        [ 0, "asc" ]
      ],
      buttons: [
          { extend: "create",
            editor: editor,
            text: "Crear"
           },
          { extend: "edit",
            editor: editor,
            text: "Editar"
           }
      ]
    });

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,296Questions: 26Answers: 4,768
    Answer ✓

    My guess is you are only returning the 'Vendedor' field when creating the row. This would cause the above error since the data for the other columns is missing. I believe you will want to return all the columns in your create response.

    Kevin

  • jfabianjfabian Posts: 13Questions: 3Answers: 0

    Thanks!

This discussion has been closed.