Uncaught -- Unable to find row identifier (Editor)

Uncaught -- Unable to find row identifier (Editor)

ttatarynttataryn Posts: 11Questions: 3Answers: 0
edited September 2018 in Free community support

I've looked at some solutions to this error, but can't seem to find a resolution.

Here's a link to a simplified version of my code: http://live.datatables.net/fimogida/4/edit

I have set idSrc to "id" and have a column created id (which I didn't want there in the first place, but for this sake I included it), however am still getting the error (when I click Edit of course).

Any particular reason why I'm still getting this error?

EDIT:

I have referred to https://datatables.net/manual/tech-notes/14 and followed the instructions (i.e. like I said above I include isSrc variable in definition of editor function)

Answers

  • ttatarynttataryn Posts: 11Questions: 3Answers: 0

    Also -- I am not using a Ajax backend as my data source so I utilized the code from a previous discussion to solve that -- it worked but the editor isn't working with the error above.

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Your test case has some errors and is not running. However the problem looks like the idSrc you are choosing is an object but your are using array based data, ie, not using the columns.data option. According to the idSrc docs you can use a number to specify the array position.
    https://editor.datatables.net/reference/option/idSrc

    The idSrc basically just needs to be a column with unique data. Is that the case with your DNS Name column? If so then you can remove the ID column and set the idSrc to the DNS Name column. If you remove the ID column then I think the option setting would be idSrc: 1,.

    Kevin

  • ttatarynttataryn Posts: 11Questions: 3Answers: 0

    @kthorngren For some reason the test case isn't showing any errors in the console for me. Any reason why that would be?

    Anyways, I tried setting DNS Name to be the idSrc, and the Edit button is "working"-- it doesn't return an error like it did, but I am not able to actually edit anything.

  • ttatarynttataryn Posts: 11Questions: 3Answers: 0
    edited September 2018

    @kthorengren I totally missed part of your answer that included setting a number. Can not believe I didn't think of that! Thank you, it works now!

    On another note, is there a way to keep the current values in the edit box? Some of them are long and would be hard to replicate

    For instance, see this example: https://editor.datatables.net/examples/simple/fieldDefaults.html

This discussion has been closed.