Can't manipulate all fields on preSubmit
Can't manipulate all fields on preSubmit
ECOH MEDIA
Posts: 4Questions: 0Answers: 0
Hi All,
i'm trying to manipulate my row before datatable editor perform the submit.
My table is made of 3 fields:
FieldA
FieldB
FieldC
and this what i've:
table.on( 'click', 'tbody td:not(:first-child)', function (e) {
paintingsTableEditor.inline( this, {
submit: 'all'
} );
paintingsTableEditor.on( 'preSubmit', function ( e, data, action ) {
console.log (data);
} );
} );
When i change a value from the datatable, in the console log i can see the data object which contains only the field i've changed but i would like to manipualate also the others fields.
Can anyone help me how to resolve this problem?
This discussion has been closed.
Replies
What version of Editor are you using? If not 1.5.5, could you update please. If that doesn't resolve the issue, could you link to the page so I can debug it please.
Allan
My Editor version is 1.5.5 and unfortunally i'm working on a complex project locally.
Next you can see my code where when the user choose a type of paint (by a select field in "item_painting.painting_id") then, on preSubmit, i would to calculate a cost:
but it doesn't work. On console log i can see the only field i'm changing and i can't see all the other fields in the row
Thanks for the code.
I think the issue is that you have:
AND
The second one won't be executing since DataTables doesn't emit a
click
event andtable
is a DataTables' API method. I would suggest removing that event listener and modifying the first one to usesubmit: 'all'
.Allan
Ok thank you, it works!