Unable to find a row identifier

Unable to find a row identifier

jcmartinjcmartin Posts: 2Questions: 1Answers: 0
edited May 2016 in Free community support

Hi!
I’m used to build my DataTables with an array. My dataset looks like this :

aData = [‘1’,’aaa’,’xxxx’],[‘2’,’bbb ‘,’xxxx’],….
I would like to use Editor but the RowID is not present and the error « Unable to find row identifier » occurs.

I tried to modify my dataset like that :
aData = [{‘id’ :’1’},’aaa’,’xxxx’], [{‘id’ :’2’},’bbb’,’xxxx’,…. and added the idSrc option in my editor object :
myEditor = new $.fn.dataTable.Editor( {
table: '#example',
idSrc: "id",
….
But the error is still there.
Is it the right method? Did I forget something?
Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,794Questions: 1Answers: 10,514 Site admin
    Answer ✓

    Hi,

    Thanks for your question. I'd ask if you could not post duplicates please. I've deleted your duplicate post on this topic and I'll reply here rather than to the message sent via the contact form.

    If you have an array data source, you can source the id value from it simply by using an integer value for the idSrc option. For example, if the id value is in array index 0 you would use idSrc: 0.

    Allan

  • jcmartinjcmartin Posts: 2Questions: 1Answers: 0

    Hi,
    Thanks a lot, I didn't think that i could use the array index for the idSrc.

    Bye

    JC

This discussion has been closed.