TypeError: this[((((((p7 + Y3) + F1q) + a1q) + P3) + s6x) + O8q)] is not a function

TypeError: this[((((((p7 + Y3) + F1q) + a1q) + P3) + s6x) + O8q)] is not a function

almircamposalmircampos Posts: 13Questions: 5Answers: 0
edited June 2015 in Free community support

I just installed the free trial and I couldn't run the Editor.

The program was working fine before I introduced the Editor. All the css and js are loading correctly (information from Firebug).

The error is:

TypeError: this[((((((p7 + Y3) + F1q) + a1q) + P3) + s6x) + O8q)] is not a function

Here is my source code (jsp):

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        
        <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.6/css/jquery.dataTables.css">
        <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/tabletools/2.2.4/css/dataTables.tableTools.css">
        <link rel="stylesheet" type="text/css" href="/Editor-1.4.2/css/dataTables.editor.css">
        
        <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
        <script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js" ></script>
        <script src="//cdn.datatables.net/tabletools/2.2.4/js/dataTables.tableTools.min.js" ></script>
        <script src="/Editor-1.4.2/js/dataTables.editor.js" ></script>
    </head>
    <body>
        <table id="example" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>NAME</th>
                    <th>OP</th>
                </tr>
            </thead>

            <tfoot>
                <tr>
                    <th>ID</th>
                    <th>Name</th>
                    <th>OP</th>
                </tr>
            </tfoot>
        </table>
        <script>
            var jsonUrlLoad = "${pageContext.request.contextPath}/inside/admin/dt01/data";
            var jsonUrlEdit = "${pageContext.request.contextPath}/inside/admin/dt01/edit";
            var editor = $.fn.dataTable.Editor(
                    {
                        "ajax": jsonUrlLoad,
                        "table": "#example",
                        "fields": [{
                                label: "ID:",
                                name: "id"
                            }, {
                                label: "Name:",
                                name: "name"
                            }]
                    });
            var example = $('#example').DataTable(
                    {
                        dom: "Tfrtip",
                        "ajax": jsonUrlLoad,
                        "columns":
                                [
                                    {"data": "id"},
                                    {"data": "name"},
                                    {
                                        "targets": -1,
                                        "data": null,
                                        "defaultContent": "<button>Click!</button>"
                                    }
                                ],
                        tableTools: {
                            sRowSelect: "os",
                            aButtons: [
                                {sExtends: "editor_create", editor: editor},
                                {sExtends: "editor_edit", editor: editor},
                                {sExtends: "editor_remove", editor: editor}
                            ]
                        }

                    });
            $('#example tbody').on('click', 'button', function ()
            {
                var data = example.row($(this).parents('tr')).data();
                console.log(data);
                console.log("The " + data.name + "'s id is: " + data.id);
            });
        </script>
    </body>
</html>

Any clues?

Thank you in advance.

Almir.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,028Questions: 1Answers: 10,555 Site admin
    Answer ✓

    Hi Almir,

    Try:

    var editor = new $.fn.dataTable.Editor(
    

    i.e. add the new keyword. Editor is a constructor.

    Allan

  • almircamposalmircampos Posts: 13Questions: 5Answers: 0

    Hi, Allan. Sorry for the late response. Yes, the problem was solved.

    Thank you a lot.

    Almir.

This discussion has been closed.