datatables.min.js:286 Uncaught Unable to find row identifier For more information, please refer
datatables.min.js:286 Uncaught Unable to find row identifier For more information, please refer
support@kosmos.de
Posts: 16Questions: 7Answers: 0
in Editor
I am getting this error in console when I click the edit button.
Uncaught Unable to find row identifier For more information, please refer to https://datatables.net/tn/14
I haved folloed the example shoed on the website, but i keep getting the msh.
What am I doing wrong?
PlanEditor
editorPlan = new $.fn.dataTable.Editor( {
ajax:{
url:'/api/v1/budgets/plan'
},
table: "#planTabelle",
idSrc:"id",
fields: [{
label: "Bezeichnung:",
name: "name",
},{
label: "Budget",
name: "betrag"
},{
...
}
]
});
GeschaeftsfeldTabelle
tabelleGeschaeftsfeld = $('#geschaeftsfeldTabelle').DataTable({
// stateSave: true,
select: {
style: 'single'
},
dom: "Bt",
ajax:{
url: "/api/v1/budgets/geschaeftsfelder",
type: "GET",
data:
function(dx){
var selected = tabellePlan.row( { selected: true } );
if ( selected.any() ) {
dx.pid = selected.data().id;
console.log(selected.data().id);
}
}
},
drawCallback: function() {
console.log("DrawCallback");
},
columns: [
{ data: "name" },
{ data: "betrag", render: $.fn.dataTable.render.number( '.', ',', 0, '€' ) },
...
This question has an accepted answers - jump to answer
Answers
You have
idSrc
set toidSrc:"id",
. Do you have anid
object as part of your row data?Kevin
yes, as you can see in the Picture above. It is shown in the table
this is the data I get
Your Editor is configured to use the table
#planTabelle
but the Datatables config you posted is for table#geschaeftsfeldTabelle
. Is the JSON response you posted for the#planTabelle
table?Can you post a link to your page or test case replicating the issue so we can take a look?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thankyou! sometimes I think im blind