Edit and Delete button icons spin instead of opening edit window

Edit and Delete button icons spin instead of opening edit window

divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

I'm on day 4 of my 15 day trial of Editor. I'm working my way through trying to see if we can use it for developing our application. I've got the DataTables basics working - it's diplaying my hardcoded html table and has the New, Edit and Delete buttons. The New button works fine. It displays the edit window and I've configured it to format the fields as a couple of select fields, a date field and a checkbox. However, the Edit and Delete buttons' icon just spins forever when I click on them. Seems to me that they should work

$('#historyTable').DataTable( {
dom: "Bfrtip",
//ajax: "../php/staff.php",
columns: [
{ data: "delete" },
{ data: "date" },
{ data: "plan" },
{ data: "status" },
{ data: "recordType" }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );

I'm using these Button files and the DataTables and Editor files as of 8/26/2019.

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css">

Thanks for any help

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,159Questions: 26Answers: 4,921

    However, the Edit and Delete buttons' icon just spins forever

    The first place to look is for errors in your browser's console. Let us know what you find.

    Kevin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    I see this error message: SCRIPT5022: Unable to find row identifier For more information, please refer to https://datatables.net/tn/14

    When I follow the link it takes me to a page that implies that I need to add idSrc: 'id', to my Editor parameters. I did but I still get the spinning icon on the Edit and Delete buttons. I'm using a very simple, hardcoded html table. Each element has an id and name but not the table rows. I'm not using JSON or any other data source, just a hardcoded html table.

  • kthorngrenkthorngren Posts: 21,159Questions: 26Answers: 4,921
    edited August 2019 Answer ✓

    Here is the Editor local editing example:
    https://editor.datatables.net/examples/simple/noAjax.html

    This example shows a DOM based table with local editing which is working.
    http://live.datatables.net/guwafemu/1/edit

    The above code snippet you posted doesn't show an id column. Without seeing what you are doing it will be difficult to offer suggestions. Please post your Editor and Datatables Javascript code. Better yet a link to your page or test case (update mine if you want) so we can help diagnose the problem.

    Kevin

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    It worked after I added "id=x" code to my <tr> elements and I deleted the idSrc: 'id' from my Editor parameters. I didn't see that I had to sequence my table rows in the examples I was working from.

    Thanks very much for the prompt and helpful help!

This discussion has been closed.