Topic: Trigger 'keyup click' event on 'mdb-content-dynamic-input' in content-editor

ImplArchDev free asked 5 years ago


I want to trigger the $wrapperEditor.not('thead, tfoot').on('keyup click', '.mdb-content-dynamic-input', keyupEvents);

in my custom button click event (btnRevalidateChanges). so basically, if i click on a td cell and enter text in the input control and then click a button that I created inside the wrapper-editor div tag. instead of making the user hit the enter key to persist the input control text to the td cell's value.

`<div class="d-flex justify-content-center buttons-wrapper my-3">

    <button id="btnMakeCellsEditable" class="btn btn-rounded text-white blue lighten-3 btn-lg add-content-edit" type="button">Make Cells Editable<i class="fas fa-toggle-off"></i></button>

    <button id="btnRevalidateChanges" class="btn btn-rounded btn-lg text-white red" type="button">Revalidate Changes</button>
</div>

$('#btnRevalidateChanges').click(function () { $('form-control mdb-content-dynamic-input').trigger( jQuery.Event('keyup click', { which: 13 }) ); });`

when i debug the "trigger(...) never executes. it just skips over it.


Krzysztof Wilk staff answered 5 years ago


Hello!

I think you just need to put a small timeout event before doing .click() like this: setTimeout(function(){ $('#btn').click()}, 100);



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.2
  • Device: web based app
  • Browser: chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No