Stand alone editor
Stand alone editor
tchristfort
Posts: 22Questions: 7Answers: 0
I use a stand-alone editor using this definition:
$("#passwordButton").on('click', function() {
pwEditor
.buttons( {
label: "Gem",
fn: function () { this.submit(); }
} )
.edit(<?PHP if (isset($prot)) {echo $prot->getUserID();} ?>, false)
.set( 'users.location', 2)
.open();
})
var pwEditor;
$(document).ready(function() {
pwEditor = new $.fn.dataTable.Editor( {
ajax: "users_server.php",
fields: [
{
label: "Nyt kodeord:",
name: "users.userPass",
type: "password"
}, {
label: "Gentag nyt kodeord:",
name: "users.repeatPass",
type: "password"
}, {
label: "Nuværende kodeord:",
name: "users.currentPass",
type: "password"
}, {
label: "Lager:",
name: "users.location",
type: "select",
options: [
{ label: 'Nybøllegård', value: 1 },
{ label: 'Iselingen', value: 2 }
]
}
]
} );
} );
The editor will submit correctly, however when results are returned form back-end I get the error:
Uncaught Could not find an element with data-editor-id
of: row_15
It is correct that I have not defined any element as I do not wish to use or show the return values if back-end updates correctly, just close the editor. How do I achieve this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You could try a little workaround:
That will replace the data from the server for the row with just an empty array, letting Editor skip over it.
Allan
Did the trick, thank you