submit() always updates all fields.
submit() always updates all fields.
Hello
I have three buttons "Cancel", "Apply" and "Submit" to match our current systems UX experience. The "Apply" saves the data without closing the form.
So, for submit, I use the this.submit() function. The form has 12 fields. If I change 1 field and the click on "Apply" or "Submit" button, the Ajax post updates all the fields, not just the 1 that was changed.
I know you can add the option "changed" to this function .submit: 'changed', but I do not know how to perform this with the "this.submit()". Any help would be great. First time posting for help.
Thanks
$('#kt_edit').on( 'click', function (e) {
e.preventDefault();
editor
.title( 'Edit User '+userId )
.buttons( [
{
text: 'Cancel',
className: 'btn btn-primary btn-primary--icon editor_buttons',
action: function () {
this.close();
}
},
{
text: 'Apply',
className: 'btn btn-primary btn-primary--icon editor_buttons',
action: function () {
this.submit();
}
},
{
text: 'Submit',
className: 'btn btn-primary btn-primary--icon editor_buttons',
action: function () {
this.submit();
this.close();
}
}
] )
.edit(userTable.rows( { selected: true } ).indexes(),{
onComplete: 'none'
} );
} );
Replies
You would add that
changed
to theedit()
, something like this:When
submit()
is called, it would use thoseform-options
from whenedit()
was called.Colin
That solved the problem. Thanks so much.