Inline edition event after editing

Inline edition event after editing

xdequinzexdequinze Posts: 8Questions: 2Answers: 0

As the user change a field, I need another field to be updated.
It works well using a listener in the edition form:

$( 'input', editor.field( 'ds_pluv' ).node() ).on( 'change', function (e, d) {
if ( ! d || ! d.editor ) { // Used to be sure change is fired from the form (not inline editing)
editor.field( 'ds_cor_pluv' ).val(true);
}
} );

But when inline editing, this appears not to be working.
Is there any other way to be able to trigger a specific action after inline editing a cell ?

Xavier

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    That should actually work with inline editing (with the default configuration). The whole row is actually placed into editing mode and any changed values will be submitted. So if ds_cor_pluv is already true it wouldn't be submitted. But if it were any other value it should be.

    If that isn't working for you, please can you give me a link to your page so I can check it out?

    Thanks,
    Allan

  • xdequinzexdequinze Posts: 8Questions: 2Answers: 0

    Hi Allan,
    If I remove the condition ( "if ( ! d || ! d.editor )" ), every input listener receives the event. I don't understand why not only the input from which the value is effectively changed. Maybe because the whole row is into editing mode ? If passing in all listener, how could I know which field was changed to avoid doing anything for the others ? Should I need to manage it myself ?
    I'll send you a link by message.
    Thank you in advance.
    Xavier

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    every input listener receives the event

    That would suggest that editor.field( 'ds_pluv' ).node() is returning null or undefined. If you add console.log( editor.field( 'ds_pluv' ).node() ); what does the console show?

    Allan

  • xdequinzexdequinze Posts: 8Questions: 2Answers: 0

    The node seems to be well logged in the console :

    Multiple valuesThe selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.
    Undo changes

    Note that everything seems to be working well using the form.

    Xavier

  • xdequinzexdequinze Posts: 8Questions: 2Answers: 0

    <div class="DTE_Field DTE_Field_Type_text DTE_Field_Name_ds_pluv "><label data-dte-e="label" class="DTE_Label" for="DTE_Field_ds_pluv">Pluie<div data-dte-e="msg-label" class="DTE_Label_Info"></div></label><div data-dte-e="input" class="DTE_Field_Input"><div data-dte-e="input-control" class="DTE_Field_InputControl"><input id="DTE_Field_ds_pluv" type="text"></div><div data-dte-e="multi-value" class="multi-value">Multiple values<span data-dte-e="multi-info" class="multi-info">The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.</span></div><div data-dte-e="msg-multi" class="multi-restore">Undo changes</div><div data-dte-e="msg-error" class="DTE_Field_Error"></div><div data-dte-e="msg-message" class="DTE_Field_Message"></div><div data-dte-e="msg-info" class="DTE_Field_Info"></div></div><div data-dte-e="field-processing" class="DTE_Processing_Indicator"><span></span></div></div>

  • xdequinzexdequinze Posts: 8Questions: 2Answers: 0

    Using input or keydown event resolves the problem.
    The change event by the user doesn't seem to be listened to.
    I need to manage now a comparison between old and new value.

    Xavier

This discussion has been closed.