A simple table. The warning "Warning about data tables: table ID = …" pops up

A simple table. The warning "Warning about data tables: table ID = …" pops up

ostmalostmal Posts: 102Questions: 33Answers: 0

A simple table. The warning "Warning about data tables: table ID = …" pops up
What kind of mysticism am I! I made an elementary table, but a warning pops up: "Warning about data tables: table ID = aaa_fio-Ajax error. For more information about this error, please see http://datatables.net/tn/7 "
Look here:
http://www.a0250268.xsph.ru/index.php

Code:

<!doctype html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" href="/abc_crm/dt/my/crm.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jqc-1.12.4/moment-2.18.1/dt-1.10.25/b-1.7.1/date-1.1.0/fc-3.3.3/fh-3.1.9/kt-2.6.2/sl-1.3.3/datatables.min.css">
        <!-- Индивидуальный поиск по столбцам -->
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
        <link rel="stylesheet" type="text/css" href="/abc_crm/dt/prog/css/generator-base.css">
        <link rel="stylesheet" type="text/css" href="/abc_crm/dt/prog/css/editor.dataTables.min.css">

        <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/v/dt/jqc-1.12.4/moment-2.18.1/dt-1.10.25/b-1.7.1/date-1.1.0/fc-3.3.3/fh-3.1.9/kt-2.6.2/sl-1.3.3/datatables.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="/abc_crm/dt/prog/js/dataTables.editor.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="/abc_crm/dt/my/fio/fio.js"></script>
    </head>
    <body class="dataTables">
        <div class="container">
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="aaa_fio" width="100%">
                <thead>
                    <tr>
                        <th>kv_id</th>
                        <th>fio_name</th>
                    </tr>
                </thead>
            </table>

        </div>
    </body>
</html>
(function($){

$(document).ready(function() {
    var editor = new $.fn.dataTable.Editor( {
        ajax: '/abc_crm/dt/my/fio/fio.php',
        table: '#aaa_fio',
        fields: [
            {
                "label": "kv_id:",
                "name": "kv_id"
            },
            {
                "label": "fio_name:",
                "name": "fio_name"
            }
        ]
    } );

    var table = $('#aaa_fio').DataTable( {
        dom: 'Bfrtip',
        ajax: '/abc_crm/dt/my/fio/fio.php',
        columns: [
            {
                "data": "kv_id"
            },
            {
                "data": "fio_name"
            }
        ],
        select: true,
        lengthChange: false,
        buttons: [
            { extend: 'create', editor: editor },
            { extend: 'edit',   editor: editor },
            { extend: 'remove', editor: editor }
        ]
    } );
} );

}(jQuery));
<?php


// DataTables PHP library and database connection
include( "lib/DataTables.php" );

// Alias Editor classes so they are easy to use
use
    DataTables\Editor,
    DataTables\Editor\Field,
    DataTables\Editor\Format,
    DataTables\Editor\Mjoin,
    DataTables\Editor\Options,
    DataTables\Editor\Upload,
    DataTables\Editor\Validate,
    DataTables\Editor\ValidateOptions;


Editor::inst( $db, 'aaa_fio', 'id' )
    ->fields(
        Field::inst( 'kv_id' ),
        Field::inst( 'fio_name' )
    )
    ->process( $_POST )
    ->json();

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,318Questions: 26Answers: 4,948
    Answer ✓

    Did you follow the steps at the troubleshooting link in the error?
    http://datatables.net/tn/7

    You will need to see what error the server is responding with and look at your server's logs to troubleshoot the error.

    Kevin

  • ostmalostmal Posts: 102Questions: 33Answers: 0

    Thank you, Kevin, for the hint. I decided: I connected the file incorrectly "DataTables.php"

Sign In or Register to comment.