How to solve: A system error has occurred (More information)?

How to solve: A system error has occurred (More information)?

nusagatesnusagates Posts: 5Questions: 1Answers: 0

When i create new, edit, or delete data using datatables editor i got message: A system error has occurred (More information).

My Javascript Code:

var table, editor;
        $(function () {
            editor = new $.fn.dataTable.Editor({
                ajax: " https://domain/bengkel/1/service/data",
                table: "#table",
                fields: [{
                    label: "Nama:",
                    name: "name"
                }, {
                    label: "Biaya:",
                    name: "price"
                }
                ]
            });
            $('#table').on( 'click', 'tbody td:not(:first-child)', function (e) {
                editor.inline( this );
            } );
            table =
                $('#table').DataTable({
                    dom: "Bfrtip",
                    ajax: "https://domain/bengkel/1/service/data",
                    columns: [
                        {data: "name"},
                        {data: "price"}
                    ],
                    select: true,
                    buttons: [
                        {extend: "create", editor: editor},
                        {extend: "edit", editor: editor},
                        {extend: "remove", editor: editor}
                    ]

                });
        })

My PHP Code:

Editor::inst($db, 'workshop_services')
            ->fields(
                Field::inst('name'),
                Field::inst('price')
            )
            ->process($_POST)
            ->debug(true)
            ->json();

Response data i got:

{"data":[{"DT_RowId":"row_2","workshop_id":103,"name":"Service","price":30000},{"DT_RowId":"row_3","workshop_id":103,"name":"Ganti Ban","price":15000}],"options":[],"files":[]}

What is wrong? Help me please.

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @nusagates ,

    Did you follow the diagnostic steps in the tech note (https://datatables.net/manual/tech-notes/12) - that would be the best place to start? If still no success, would you be able to link to the page, please.

    Cheers,

    Colin

  • nusagatesnusagates Posts: 5Questions: 1Answers: 0

    Thanks for your reply.
    Yes i followed the instruction described at https://datatables.net/manual/tech-notes/12

    I enclose screenshot from developer tools.

    i did not find any error from there. What should i do then?

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Hi,

    That is the data that is used to load the table. You need to trigger the error (while you have the inspector open) so you can via the error response from the server. So:

    1. Load your page
    2. Open the network inspector
    3. Do the edit action that causes the error
    4. Look at the network inspector for the latest response. It should be invalid JSON. Hopefully including an error message.

    Allan

  • nusagatesnusagates Posts: 5Questions: 1Answers: 0

    There is no network activity when i editing something. I sent you the detail via private mesage. Please help me.

This discussion has been closed.