Update from Version 1.x to 2.x
Update from Version 1.x to 2.x
Andreas S.
Posts: 208Questions: 74Answers: 4
in Editor
I have updated the Editor to the last Version of it, but now i have a Problems with the create. I get after submiting a create action following JS error:
TypeError: Cannot read property 'DT_RowId' of null ....
With the old Version the Problem is not available. I think i have a problem with the editor Definition.
athForm = new $.fn.dataTable.Editor( {
table: '#athtbl',
ajax: '/assets/php/api/athletes.php?ath=2',
display: 'bootstrap',
template: '#tplAthlete',
fields: [
{
label: frmInfo.a_uuid + ':',
name: 'a_uuid',
data: 'DT_RowId',
type: 'readonly'
},{
label: frmInfo.a_lastname + ': <span class="txt-Red">*</span>',
name: 'a_lastname',
data: 'lastname'
},{
label: frmInfo.a_firstname + ': <span class="txt-Red">*</span>',
name: 'a_firstname',
data: 'firstname'
},{
......
The DT_RowID is needed to show with the edit action. The edit and delete action works with no Problems
Any Idea how can i solve the JS error
Andreas
This question has accepted answers - jump to:
Answers
Nothing obviously wrong there I'm afraid. Can you give me a link to your page please?
Thanks,
Allan
Send you the link with a PM
Andreas
Hi Andreas,
Apologies for the delay in getting back to you here. The data coming back from the server when creating a new row (from
athletes.php
) is not quite in the format that DataTables / Editor expects. Specifically currently you are returning:But
data
should be an array of objects:Is
athletes.php
using your own code, or our Editor PHP libraries?Allan
Thanks for the Information. athletes.php is my own code. It's interesting that version 1 can handle this
Do you have the
legacyAjax
parameter set perhaps? Support for that was removed in v2.Allan