I am trying to store the value of the additionalPayerAmount before I remove the row.
I am trying to store the value of the additionalPayerAmount before I remove the row.
guccio
Posts: 2Questions: 1Answers: 0
I can use initEdit and it works
editor.on( 'initEdit', (e, id, values) => {
var oldAmount = editor
.field( 'additionalPayerAmount' )
.get();
$(currentEditAmountPrior).val(oldAmount);
} );
When I use initRemove the field is blank
editor.on( 'initRemove', (e, id, values) => {
var oldAmount = editor
.field( 'additionalPayerAmount' )
.get();
$(currentEditAmountPrior).val(oldAmount);
} );
Answers
The
initRemove
has four parameters that are passed:( e, node, data, items )
. Thedata
parameter is an array of row(s) to be deleted. See if this gets the data of the first row:I think the
field().get()
in theinitRemove
event doesn't work because there are no editor fields used when removing.Kevin
Kevin ... worked perfectly.
editor.on( 'initRemove', (e, id, data,values) => {
Just needed to add "data" to the example you wrote.
Thank you so much for taking the time to help.