I am trying to have some sort of control on the table data before sending to the server and so I decided to use onPreSubmit.
To check if I was doing right, I tried the following:
but the alert message instead says: "hey, you are undefined!"
'nome' is a field which is correctly loaded and displayed both in the table and in editor's form.
…I can't understand why the 'data.nome' property turns out to be undefined.
What am I doing wrong?
To check if I was doing right, I tried the following:
var editor;
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": tUrl, // php
"domTable": "…",
"fields": [ …]
});//end editor
...
...
editor.on ( 'onPreSubmit',
function (e, data) {
var d = data.nome;
alert("hey, you are " + d +"!");
return false; // just to be safe
}
);
});//end $.(document).ready
When clicking the submit button on editor's form, I expected to see an alert with the message "hey, you are -name on the form- !",but the alert message instead says: "hey, you are undefined!"
'nome' is a field which is correctly loaded and displayed both in the table and in editor's form.
…I can't understand why the 'data.nome' property turns out to be undefined.
What am I doing wrong?