How to get an event.target from event on input helper in ember

713 Views Asked by At

iam using input helper in ember for binding attributes value

<div class="form-group profile-desa-component-form-group">
          <label class="col-sm-4 control-label">{{t 'field.alamat'}}</label>
          <div class="col-sm-8 no-padding">
            {{#if editMode}}
              {{input class="form-control editonly btn-no-corner" key-press="onKeyPressShowPanel" type="text" value=alamat}} <- this is my input helper
            {{else}}
              <input readonly class="form-control btn-no-corner readonly" type="text" value={{alamat}}>
            {{/if}}
          </div>
          {{backend/pop-up-form title="Isikan alamat lengkap kantor desa dan kelurahan"}}
        </div>

i just want to pass an event object from key-press = onKeyPressShowPanel to the controller so i can use event.target to manipulate some element via jquery snipet. this is my onKeyPressShowPanel action in controller

onKeyPressShowPanel(event){
      this.debug(event);
    },

unfortunately the event that i pass is a value that come from value = alamat. how to get an event.target from event on input helper so i can manipulate some element using jquery. Any answers would be helpfull for me.. thank you :)

1

There are 1 best solutions below

1
On

You can try the below code to get jquery.Event object,

{{input class="form-control editonly btn-no-corner" keyPress=(action "onKeyPressShowPanel") type="text" value=alamat}}

manipulate some element using jquery -Generally is not good but it depends on your case