preSubmit data undefined
preSubmit data undefined
ficos.nl/test/uren2015.html
is the test of this problem.
Using preSubmit:
editor
.on('preSubmit',function( e, data, action ){
if(action=='create'){
alert(data.rec_omschr);
data.rec_Persoon='2000';
}
}
);
data keeps undefined. And I need to change the field rec_Persoon after creating but before submitting
Can you help please?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi,
There is no
rec_omschr
parameter in the information that DataTables sends to the server. The fields are contained within another object (identified by the primary key value) as described here.Your best bet is to use
$.each( data.data, function ( value, key ) { ... } );
and loop over the data to be submitted for each row that way.Regards,
Allan
Hi Allan,
I thought I understood but this is not working:
Any idea why?
Jan
Solved.
To get the first element in the array you would change this:
To this:
Removing the quotes to make it an integer.
Kevin