[Editor] editor dropping tr.id attribute after saving a row

[Editor] editor dropping tr.id attribute after saving a row

ajungajung Posts: 14Questions: 5Answers: 0

Latest DT, latest Editor.

The initial table markup with two columns looks like this:

After editing a row and saving it back, the related <tr> element has no longer an id attribute which leads to the
" Unable to find row identifier For more information, please refer to https://datatables.net/tn/14" error.

I tried to add idSrc: "id" to the editor configuration, which has the effect that I receive this error directly when clicking on a row.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    I'm not seeing that problem in this example. Can you link to a page showing the issue please?

    Allan

  • ajungajung Posts: 14Questions: 5Answers: 0
    edited May 3

    Different example with a row before editing and after saving:

  • kthorngrenkthorngren Posts: 21,329Questions: 26Answers: 4,949

    Possibly the JSON response after editing doesn't have the id? Use the browser's network inspector to look at the JSON response after editing a row. If that doesn't help then we will need more information to help debug. A link to your page or test case showing the issue is the best option. You can PM Allan with a link if you don't want it public. If you can't do that then start by posting the JSON response from editing, Editor and Datatables configs.

    Kevin

  • ajungajung Posts: 14Questions: 5Answers: 0
    edited May 3

    The response contains an id:

    {
        "data": [
            {
                "gebaeude": "D1.2",
                "etage": "EG",
                "raum": "001",
                "bezeichnung": "Lackmus 2 % in wäßriger Lösung TECHNICAL pH-Indikator",
                "cas_nr": "1393-92-6",
                "kennung": "xxxx",
                "menge": "123",
                "mengeneinheit": "KG",
                "status": "aktiv",
                "id": "64957835",
                "cas_str": "Lackmus 2 % in wäßriger Lösung TECHNICAL pH-Indikator",
                "modified": "2024-05-03T11:40:43.329875",
                "action": ""
            }
        ]
    }
    

    I will try to setup something on a public server.

Sign In or Register to comment.