Cannot add field for editor
Cannot add field for editor
Hello!
This is working fine:
var editor;
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "ajax/stand_status_object.php",
table: "#example",
fields:
[
]
});
$('#example').dataTable( {
dom: 'T<"clear">lfrtip',
"processing": true,
ajax: "ajax/stand_status_object.php",
columns: [
{ data: null, render: function ( data, type, row ) {
// Combine the first and last names into a single table field
return data.first_name+' '+data.last_name;
} },
{ data: "position" },
{ data: "office" },
{ data: "extn" },
{ data: "start_date" },
{ data: "salary" }
],
tableTools: {
sRowSelect: "os",
sRowSelector: 'td:first-child',
aButtons: [
{ sExtends: "editor_edit", editor: editor },
]
}
} );
} );
I can see my items loaded and shown in the table. I can see the edit button, but when i press it it's empty. Because the fields parameter is empty. But when i try to add anything like :
{
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:",
name: "position"
}, {
label: "Office:",
name: "office"
}, {
label: "Extension:",
name: "extn"
}, {
label: "Start date:",
name: "start_date",
type: "date"
}, {
label: "Salary:",
name: "salary"
}
Then the table is no longer load. Any idea? Thanks in advance.
Answers
Sounds like a Javascript error is occurring. If you look at the console in your browser when that happens, are there any errors reported?
Allan
TypeError: g[(((((((((((q7 + a16) + L3) + J4) + X26) + G26) + G4) + L8) + X26) + N6) + A8) + e86)] is not a function
http://xyz/js/dataTables.editor.js
Line 47
Hmm - a little tricky that one :-). Are you able to link me to the page so I can take a look?
Thanks,
Allan
You cant reach it sadly. Any tip what to try to solve it?
Can you show me the exact code your are using for the Javascript on the page, and the full HTML (i.e. everything!) so I can take a look and see what might be happening.
Thanks,
Allan