Editor processing in DOM on local Javascript Object array

Editor processing in DOM on local Javascript Object array

david.j.meyer2@boeing.comdavid.j.meyer2@boeing.com Posts: 54Questions: 15Answers: 0

Link to test case: http://live.datatables.net/giyiqiwe/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Scripts/Editor/js/dataTables.editor.min.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'processing'

Occurring on "this.processing(!0)"

Description of problem:
I am attempting to load data from a javascript object array. The tables load fine but the problem is occurring when i setup the editor. Ideally, i only want to edit one field in the record. It is a "Y" or "N" value. I only want the data to save locally to the table when updated. I will gather all the data and perform a custom submit to save to the database.

When i select the edit button i get an error in dataTables.editor.min.js.

I have not used the test case environment before but did attempt to emulate.

The example i provided uses a representative javascript object as the data source for the datatables. In my "actual" version the buttons load fine, not sure why in the test case provided they dont appear. When i added the editor script (1.9.6) the table stopped loading completely.

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    http://live.datatables.net/giyiqiwe/2/edit

    It appears to work okay for me there (I just rearranged the <script> tags a little), but that is using Editor 2.0.5.

    If you use the non-min version of Editor 1.9.6, could you tell me what line the error is happening on please?

    Allan

  • david.j.meyer2@boeing.comdavid.j.meyer2@boeing.com Posts: 54Questions: 15Answers: 0

    I have included a screen capture which shows the line is failing. Its setting the processing(ture).

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    That’s a Button’s action function. What version of Buttons are you using? That method was introduced in Buttons 1.3.

    Allan

  • david.j.meyer2@boeing.comdavid.j.meyer2@boeing.com Posts: 54Questions: 15Answers: 0

    They are all custom functions except edit. Included below is the datatable script.

        dgItem = $("#dgItem").DataTable({
            dom: 'Brtr',
            scrollY: '50vh',
            "sScrollX": "100%",
            "scrollCollapse": true,
            //serverSide: false,
            processing: true,
            //datatype: 'json',
            rowId: "ITEM",
            data: DefaultListInfo.CurrentListACLData,
            paging: false,
            select: true,
            columns: [
                { data: 'ACTION', title: "Action" },
                { data: 'ITEM_DENY', title: "Deny" },
                { data: 'ITEM', title: "Item" },
                { data: 'ITEM_ENTITLEMENT', visible: false, title: "REDARS" },
                { data: 'ITEM_TYPE', visible: false, title: "Type" },
                { data: 'ITEM_REV', visible: false, title: "Rev" },
                { data: 'ITEM_SHT', visible: false, title: "Sheet" },
                { data: 'LIST_NAME', visible: false, searchable: false, title: "LIST_NAME" }
            ],
            columnDefs: [
                { "width": "5%", "targets": 0 },
                { "width": "5%", "targets": 1 },
                { "width": "15%", "targets": 2 },
                { "width": "5%", "targets": 3 },
                { "width": "5%", "targets": 4 },
                { "width": "5%", "targets": 5 },
                { "width": "5%", "targets": 6 },
                { "width": "5%", "targets": 7 }
            ],
            buttons: [
                {
                    text: 'RESTORE',
                    action: function (e, dt, node, config) {
                        $("#buttonRestoreDialog").attr("data-callingtable", "dgItem");
                        $("#restoreDialog").modal('show');
                    }
                },
                {
                    text: 'DELETE',
                    action: function (e, dt, node, config) {
                        $("#buttonDeleteDialog").attr("data-callingtable", "dgItem");
                        $("#deleteDialog").modal('show');
    
                    }
                },
                {
                    text: 'DELETE ALL',
                    action: function (e, dt, node, config) {
                        $("#buttonDeleteAllDialog").attr("data-callingtable", "dgItem");
                        $("#deleteAllDialog").modal('show');
                    }
                }
                ,
                {
                    text: 'DENY',
                    action: function (e, dt, node, config) {
                        ToggleAllowDeny(plmConstants.YES_SHORT);
    
                    }
                },
                {
                    text: 'ALLOW',
                    action: function (e, dt, node, config) {
                        ToggleAllowDeny(plmConstants.NO_SHORT);
    
    
                    }
                },
                { extend: "edit", editor: editor }
    
            ]
        });
    
  • kthorngrenkthorngren Posts: 21,459Questions: 26Answers: 4,975
    edited October 2021

    Did you verify the version of the Buttons extension you are using? The Debugger is an easy way to find out.

    Kevin

Sign In or Register to comment.