Unable to find row identifier
Unable to find row identifier
belethan
Posts: 7Questions: 1Answers: 0
The server sent back the following data and when you click the edit or delete button, an error message is returned 'Uncaught Unable to find row identifier "
{draw: "1", recordsFiltered: 3, recordsTotal: 3,…}
data:[{DT_RowID: "row_1", name: "bleu", info: "theme essais direct"},…]
0:{DT_RowID: "row_1", name: "bleu", info: "theme essais direct"}
DT_RowID:"row_1"
info:"theme essais direct"
name:"bleu"
1:{DT_RowID: "row_2", name: "rouge", info: "test 2 "}
DT_RowID:"row_2"
info:"test 2 "
name:"rouge"
2:{DT_RowID: "row_3", name: "violet", info: "test 3"}
DT_RowID:"row_3"
info:"test 3"
name:"violet"
draw:"1"
recordsFiltered:3
recordsTotal:3
JS code is:
table.DataTable({
serverSide: true, // enable/disable server side ajax loading
sDom: '<"dt-panelmenu clearfix"l<"btn-group-table col-xs-4"B>fr>t<"dt-panelfooter clearfix"ip>',
sAjaxSource: 'view/',
select:true,
aoColumns: [
{mData: "name"},
{mData: "info"}
],
columnDefs: [
{ "name" : "name","sWidth": "30%",'orderable': true,"searchable": true,'targets': [0]},
{ "name" : "info","sWidth": "25%",'orderable': true, "searchable": true,"targets": [1]}
],
lengthChange: false,
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }
]
})
I do not know how to solve the problem. have you ever had the problem?
jquery 1.12.3
DataTable 1.10.12
Editor 1.5.6
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Here more information about the html code of dataTable. no ID on lbalise TR and I do not know why
after some research I have code that is not the ID assignment on TR
Someone he already had the problem?
the function is in the file jquery.dataTables.js
function fnRowAttributes( settings, row )
var data = row._aData;
data content = Object {DT_RowID: "1", name: "bleu", info: "theme essais direct"}
id = settings.rowIdFn( data );
** and id is undefined.**
Please if you can help me, I do not understand why it returns null
Could you show me your Editor initialisation? Are you setting the
idSrc
option?If you could link to the page please I would be able to identify the issue immediately and let you know what the problem is.
Allan
thank you for your quick response and it joined the editor's statement
No I have not used idSrc
Interesting. I'm afraid I don't see any reason why the above wouldn't work.
Could you give me a link to the page so I can debug it directly please? PM me by clicking my name above and then Send message if you don't want to make it public.
Allan
I can not make available the pages from the outside because I am on VM that does not allow incoming access.
The source part is written CAKEPHP 3.0
I just reload the latest version of datatables and editor and I have no error but when the form editor opens the data are not loaded and TR tag has not ID.
Can there be conflict with the various JS files?
I fear it .
thank you very much for your attention to my problem. I recondtionner my environment to avoid conflict.
I'll keep you informed on developments.
I guess it is possible. If that is the case I would expect there to be an error shown in the Javascript console in your browser. Is there?
Can you run the debugger on your page?
Allan
I did not know this debug solution.
Here is the code for ebicis analysis.
Thanks a lot for your help.
Thanks for the debug code - I've got it now.
The issue is one of capitalisation. The JSON for your records contains
DT_RowID
, however, the default that DataTables looks for isDT_RowId
. Note the change in case of the lastd
.If you change it to be
DT_RowId
, I believe it should work as expected.Allan
You are right and I congratulate you for having found the error.
you are great and I hope to help you in return another.
thank you very much