Please specify the field name
Please specify the field name
fcalmon
Posts: 3Questions: 1Answers: 0
Hi Allan,
Thanks for the trial version. I just can;t figure out how to get rid of this error (Unable to automatically determine field from source. Please specify the field name): Code below:
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "/calculator_functions.php",
table: "#dataTable",
fields: [ {
label: "Lead ID:",
name: "lead_id"
}, {
label: "Email Status:",
name: "email_status"
}, {
label: "Read Status:",
name: "read_status"
},
{
label: "Source:",
name: "source"
}, {
label: "Valid Territory:",
name: "valid_territory"
}, {
label: "Name:",
name: "name"
},{
label: "Contact Number:",
name: "contact_number"
}, {
label: "Email:",
name: "email"
}, {
label: "Suburb:",
name: "suburb"
},
{
label: "Post Code:",
name: "postcode"
}, {
label: "Territory:",
name: "territory"
},{
label: "Specialist:",
name: "specialist"
}, {
label: "Date of Submission:",
name: "date_of_subimission"
}, {
label: "Message:",
name: "message"
},
{
label: "OS - Browser:",
name: "os_-_browser"
}, {
label: "Referrer:",
name: "referrer"
}, {
label: "ACTION:",
name: "action"
}
]
} );
$('#dataTable').on( 'click','tbody td', function (e) {
console.log(this,$(this).data('field'));
editor.inline( this,{submitOnBlur: true} );
} );
jQuery('#dataTable').on( 'init.dt', function () {
// console.log( 'Table initialisation complete: '+new Date().getTime() );
jQuery('#dataTable tbody tr').each(function(){
jQuery(this).attr('id', jQuery('td:first-child span',this).attr('id'));
});
} ).dataTable( {
"bJQueryUI": true,
"iDisplayLength": 50,
"autoWidth": false,
<?php if($admin){ ?>
"sDom": '<"H"Tfpir>t<"F"ip>S',
<?php }else { ?>
"sDom": '<"H"fpir>t<"F"ip>S',
<?php } ?>
"order": [<?=($admin?12:11)?>,'desc'],
//"columnDefs": [{"searchable": false, "width": <?=($admin?"'180px'":"'100px'")?>, "targets": <?=($admin?14:13)?> }],
"tableTools": {
"sSwfPath": "js/DataTables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
"aButtons":[{
"sExtends": "csv",
"sButtonText": "Export table to excel"
}],
ajax: "/calculator_functions.php",
columns: [
{data: "lead_id"},
{data: "email_status"},
{data: "read_status"},
{data: "source"},
{data: "valid_territory"},
{data: "name:",editField:"name:"},
{data: "contact_number"},
{data: "email"},
{data: "suburb"},
{data: "source"},
{data: "postcode"},
{data: "territory"},
{data: "specialist"},
{data: "date_of_submission"},
{data: "message"},
{data: "os_-_browser"},
{data: "referrer"},
{data: "action"}
],
}
});
});
This discussion has been closed.
Answers