Unable to find a row identifier
Unable to find a row identifier
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
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 useidSrc: 0
.Allan
Hi,
Thanks a lot, I didn't think that i could use the array index for the idSrc.
Bye
JC