Initial version doesn't work

Initial version doesn't work

paintitblackpaintitblack Posts: 60Questions: 20Answers: 0
edited August 2016 in Free community support

Hello,

I tested the editor basic version and it doesn't work and I always get the error message:

TypeError: s is undefined in dataTables.editor.min.js:670:2
uncaught exception: Error adding field - unknown field type text

Attached you can see my version with absolut pathes (excluding the dataTables.editor.min.js):

<!doctype html>
<html>
        <head>
                <meta http-equiv="content-type" content="text/html; charset=utf-8" />

                <title>DataTables Editor - _test</title>

                <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
                <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.2.1/css/buttons.dataTables.min.css">
                <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.2.0/css/select.dataTables.min.css">
                <link rel="stylesheet" type="text/css" href="https://editor.datatables.net/extensions/Editor/css/editor.dataTables.min.css">

                <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.min.js"></script>

                <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
                <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.2.1/js/dataTables.buttons.min.js"></script>
                <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/select/1.2.0/js/dataTables.select.min.js"></script>
                <script type="text/javascript" language="javascript" src="js/dataTables.editor.min.js"></script>

<script type="text/javascript" language="javascript">
var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "https://editor.datatables.net/examples/php/staff.php",
        table: "#example",
        fields: [ {
                label: "First name:",
                name: "first_name"
            }, {
                label: "Last name:",
                name: "last_name"
            }, {
                label: "Position:",
                name: "position"
            }, {
                label: "Office:",
                name: "office"
            }, {
                label: "Extension:",
                name: "extn"
            }, {
                label: "Start date:",
                name: "start_date",
                type: "datetime"
            }, {
                label: "Salary:",
                name: "salary"
            }
        ]
    } );

    $('#example').DataTable( {
        dom: "Bfrtip",
        ajax: "https://editor.datatables.net/examples/php/staff.php",
        columns: [
            { data: null, render: function ( data, type, row ) {
                // Combine the first and last names into a single table field
                return data.first_name+' '+data.last_name;
            } },
            { data: "position" },
            { data: "office" },
            { data: "extn" },
            { data: "start_date" },
            { data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
        ],
        select: true,
        buttons: [
            { extend: "create", editor: editor },
            { extend: "edit",   editor: editor },
            { extend: "remove", editor: editor }
        ]
    } );
} );
</script>

       </head>
        <body class="dataTables">

<table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Extn.</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Extn.</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </tfoot>
    </table>

        </body>
</html>

Can anybody see themistake? I tried different ways and I always get thesame error message :-( Or did it depand on my browser (Firefox)?

Thanks for any help

Paintitblack

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • paintitblackpaintitblack Posts: 60Questions: 20Answers: 0

    I put the simple version (https://editor.datatables.net/examples/simple/simple.html) on my server http://wechselstube.host4free.de/examples/simple/simple.html and the json file sends a response (http://wechselstube.host4free.de/examples/php/staff.php).

    The error must depand on the jquery code. Any ideas? Anybody?

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin

    It looks like the trial you are using has expired. The warning message at the top (either about the trial expiring or it not working if it is the code from editor.datatables.net directly) has been removed, which is why there isn't a useful information message explaining what is going wrong. Once the trial has expired random error messages like that are thrown. A license would need to be purchased to continue using Editor, or I can extend your trial if you would like to continue testing it (although I don't actually see a trial license for your account).

    Allan

  • paintitblackpaintitblack Posts: 60Questions: 20Answers: 0

    ok thank you very much for your reply. I guess I downloaded the current version with another E-Mail-Adresse a couple of weeks ago. Unfortunately I have not much time these days. Maybe I download a trial version next week and try it again. If it works as aspected I will purchase a version of the Editor :-)

    Paintitblack

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin

    I've removed the existing trial version for your account, so next time you download Editor it will start a new trial.

    Regards,
    Allan

  • paintitblackpaintitblack Posts: 60Questions: 20Answers: 0

    Now it works very well and I will try some functions the next days :-) Thanks for your suppurt up to now.

This discussion has been closed.