Fnclick on button results in "null is not an object (evaluating 'editor.i18n')"
Fnclick on button results in "null is not an object (evaluating 'editor.i18n')"
dataTables v.10.7
Editor v 1.5.2
This is a very strange problem:
I have two identical Editors. Both are called via a click on a button (still TableTools). The first editor loads perfectly. The second produces the above mentioned error.
If I call the first editor with the second button, the editor loads correctly.
this is the code for the first editor
/*-----------------------------START Remarks editor for Letters------------------------------------------------*/
remarksEdit = new $.fn.dataTable.Editor( {
ajax: "../php/DTE/letters.php",
table: "#letters",
fields: [ {
label: "Remarks:",
name: "letters.remarks",
type: 'textarea',
attr: {
placeholder: "Please enter a comment here"
}
}
]
} );
and here comes the code for the second editor
/*-----------------------------START Remarks editor for Files------------------------------------------------*/
remarksFilesEdit = new $.fn.dataTable.Editor( {
ajax: "../php/DTE/files.php",
table: "#files",
fields: [ {
label: "Remarks:",
name: "files.remarks",
type: 'textarea',
attr: {
placeholder: "Please enter a comment here"
}
}
]
} );
The error is triggered in dataTables.editor.js at line 6450.
Has anyone an idea what I do wrong?
This question has an accepted answers - jump to answer
Answers
Are you able to give me a link to the page so I can debug it please?
Thanks,
Allan
I installed it on a public server:
http://www.co-gmbh.com/GH-BDMS/public/BMISinit.php
It is the Remarks button on either tab
Thanks for the link. It looks like a code order issue. Specifically:
is being run before
remarksFlsEdit
has been initialised. So it is undefined at the time of initialisation and hence the issue.If you initialise that Editor before using it, I think it should be resolved.
Allan
Thanks Allan,
spot on!! Works now. I will remember that.
I shall take the link offline again.
Ekke