Error drawing table after submit on edit modal when SideSide is false as needed for column filter

Error drawing table after submit on edit modal when SideSide is false as needed for column filter

AVHtechAVHtech Posts: 8Questions: 4Answers: 1
edited January 4 in Free community support

I am trying to implement column filters as explained here https://datatables.net/extensions/fixedcolumns/examples/styling/col_filter.html

The filters only work with ServerSide: false
However with ServerSide: false I receive and error "Uncaught Error: DataTables warning: table id=DataTable - Requested unknown parameter '0' for row 4, column 0." when updating a record using the edit modal. The data does however get updated it just seems it is not able to redraw the table and the modal does not close.

With ServerSide true the editing and table load works great but filters don't work.

Any info directing me in the right direction will be appreciated. I think a method to apply column foters with serverside processing is probably what I need.

My table:

var invTable = $('#inventoryDataTable').DataTable(
    {
        dom: 'Brtip',
        select: true,
        serverSide: false,
        search: true,
        searching: { regex: true },
        paging: true,
        ajax: fetchOrigin + '/app/src/get-data.php?s=getList',
        "columns": [
            null, 
            null, 
            null, 
            null,
            null, 
            null, 
            null, 
            { "visible": false }, 
            { "visible": false },
            { "visible": false }, 
            { "visible": false },
            { "visible": false } 
            ],
        buttons: [
            { extend: 'create', editor: editorCreate },
            { extend: 'edit',   editor: editor },
            { extend: 'remove', editor: editor },'csv', 'excel', 'pdf', 'print'
        ]
    }
);

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

Answers

  • kthorngrenkthorngren Posts: 21,554Questions: 26Answers: 4,994
    edited January 4

    However with ServerSide: false I receive and error "Uncaught Error: DataTables warning: table id=DataTable - Requested unknown parameter '0' for row 4, column 0." when updating a record using the edit modal.

    What is the JSON response, using the browser's network inspector, when updating a record?

    Maybe you don't want to debug this if you need server side processing enabled. If you don't want to debug this then we don't need to see the response.

    With ServerSide true the editing and table load works great but filters don't work.

    The server side processing script is responsible for searching, sorting, etc. Are you using a Datatables supplied server side processing script? If not possibly your script doesn't support column searches.

    Using the browser's network inspector you should see the column search term sent in the XHR request parameters for the appropriate column. See the SSP protocol docs](https://datatables.net/manual/server-side) for details. Do you see this?

    Kevin

Sign In or Register to comment.