Why this event doesn't works ? HELP !

Why this event doesn't works ? HELP !

EmilioHayesEmilioHayes Posts: 5Questions: 2Answers: 0
edited December 2017 in Editor

editor.field( 'myField' ).input().on( 'change', function () {
editor.submit();
});
what happens is it do the action just inmediatly after i just active the inline editor, i mean just when i click and then the select is visible, then inmediatly do the action in this case ( editor.submit() ), it don't wait to user change the value.

Well if you don't have the answer of that question i found another way where im stuck too.
And it is leave the code like that but add a condition where we are going to compare the current value with the new one . so that can work but i dont know how to get the current value i think i have to get it from row.data()['property']..

editor.field( 'myField' ).input().on( 'change', function () {
if( editor.field( 'myField' ).val() != currentValue )
{
editor.submit();
}
});

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,880Questions: 1Answers: 10,139 Site admin
    Answer ✓
    editor.field( 'myField' ).input().on( 'change', function (e, d) {
      if ( ! d.editor ) {
        editor.submit();
      }
    });
    

    should do it.

    There was a thread last week about this where contains more details if you are interested.

    Allan

This discussion has been closed.