Unhandled exception when adding Editor on the page

Unhandled exception when adding Editor on the page

FrChFGoFrChFGo Posts: 22Questions: 5Answers: 0

Hi,
My page worked with Datatable. I am trying to add "Editor". I get an error loading the page (screenshot attached)

Unhandled exception at line 3881, column 3 in http://localhost:56296/Datatables/datatables.js

0x800a01bd - JavaScript runtime error: Object doesn't support this action..

COuld you give me some Help please?

Now, my code:

Includes:

<script src="/Datatables/datatables.js"></script>
<script src="/Datatables/DataTables-1.10.16/js/jquery.dataTables.js"></script>
<script src="/Datatables/Buttons-1.5.1/js/dataTables.buttons.js"></script>
<script src="/Datatables/Select-1.2.4/js/dataTables.select.min.js"></script>
<script src="/Datatables/KeyTable-2.3.2/js/dataTables.keyTable.min.js"></script>

the table:

    <h3>Aubes de Diffuseur</h3>
    <table class="display" id="aubeTable">
        <thead>
            <tr>
                <th></th><th>id col</th><th>nom col</th><th>id aube</th>
                <th>nomAube</th><th>numéro aube</th>
            </tr>
        </thead>
    </table>

my script:

    <script>
        var editor;

        $(document).ready(function () {

            editor = new $.fn.dataTable.Editor({
                ajax: "/MultiTableTest/_UpdateDataAube",
                idSrc: "id",
                table: "#aubeTable",
                fields: [{
                    label: "Id collecteur:",
                    name: "idCollecteur",
                    type: "readonly"
                },
                {
                    label: "Nom collecteur:",
                    name: "nomCollecteur",
                    type: "readonly"
                }, {
                    label: "Id aube:",
                    name: "id",
                    type: "readonly"
                }, {
                    label: "Nom aube:",
                    name: "nomAube"
                }, {
                    label: "Numero aube:",
                    name: "numeroAube"
                }
                ],

                formOptions: {
                    inline: {
                        onBlur: 'submit'
                    }
                }
            });

        $('#aubeTable').dataTable({
          "ajax": {
              "url": "/MultiTableTest/_loadDataAube",
              "type": "GET",
              "datatype":"json"
            },

          "columns": [
              {
                  "data": null,
                  "defaultContent": "",
                  "className": "select-checkbox",
                  "orderable": false
              },
              
              { "data": "idCollecteur", "autoWidth": true, "searchable": false },
              { "data": "nomCollecteur", "autoWidth": true, "defaultContent": "-" },
              { "data": "idAube", "autoWidth": true, "visible": false, "searchable": false },
              { "data": "nomAube", "autoWidth": true },
              { "data": "numeroAube", "autoWidth": true }
          ],
          "keys": {
              columns: ':not(:first-child)',
              keys: [9],
              editor: editor,
              editOnFocus: true
          },
          "select":true,
          "buttons": [
              { extend: "create", editor: editor },
              { extend: "edit", editor: editor },
              { extend: "remove", editor: editor }
          ]
        });
  });

    </script>

Replies

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    What browser are you using? Also, what options did you select in the download builder (it will say at the top of your DataTables JS file).

    Allan

  • FrChFGoFrChFGo Posts: 22Questions: 5Answers: 0
    edited January 2018

    Package list:

     * Included libraries:
     *   jQuery 3 3.2.1, JSZip 2.5.0, pdfmake 0.1.32, DataTables 1.10.16, AutoFill 2.2.2, Buttons 1.5.1, Column visibility 1.5.1, Flash export 1.5.1, HTML5 export 1.5.1, Print view 1.5.1, ColReorder 1.4.1, FixedColumns 3.2.4, FixedHeader 3.1.3, KeyTable 2.3.2, Responsive 2.2.1, RowGroup 1.0.2, RowReorder 1.2.3, Scroller 1.4.3, Select 1.2.4
     */
    
    

    I have had editor later
    I have download it and put the folder Editor-1.7.0 on my Datatable Folder...

  • FrChFGoFrChFGo Posts: 22Questions: 5Answers: 0

    I tried to replace the package with a new downloaded version including Editor, I obtain the same issue...

  • FrChFGoFrChFGo Posts: 22Questions: 5Answers: 0

    After complete reinstall of all tools, it works.

    Thanks

This discussion has been closed.