Is it possible to clear a prior field when using the 'Duplicate' button in Editor?

Is it possible to clear a prior field when using the 'Duplicate' button in Editor?

getz.hl@gmail.comgetz.hl@gmail.com Posts: 4Questions: 3Answers: 0

I am utilizing the Duplicate Button feature to enable adding entries to an existing (master) item, by capturing the item's master ID. However, I wish to 'erase' the text from the prior entry when the Editor window opens. My searches haven't led me to a solution. Can you point me in the right direction?

Answers

  • getz.hl@gmail.comgetz.hl@gmail.com Posts: 4Questions: 3Answers: 0

    Okay. I was able to modify the function of the Duplicate Button. This solution appears to be working fine.


    buttons: [ // { extend: "create", editor: editor }, // { extend: "edit", editor: editor }, { extend: "selected", text: 'Add Note', action: function ( e, dt, node, config ) { // Place the selected row into edit mode (but hidden), // then get the values for all fields in the form var values = editor.edit( table.row( { selected: true } ).index(), false ) .val(); // Create a new entry (discarding the previous edit) and // set the values from the read values editor .create( { title: 'Add new service note', buttons: 'Add note' } ) .set( values ) .set( 'svc_1notes.note', '' ); } } // { extend: "remove", editor: editor } ],
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Looks good to me - thanks for posting back.

    Allan

This discussion has been closed.