Confirm Edit/Create with Enter on Password-Input

4 posts, 2 answers
  1. Steve
    Steve avatar
    17 posts
    Member since:
    Oct 2014

    Posted 04 Jan Link to this post

    Hi,

    we're using a KendoUI ListView in our application to create, edit and delete credentials. If you add or edit a ListView item, there are inputs for Domain, Username, Password. The ListView is set to be navigatable, using the built-in events from Kendo UI. So for example if you press Enter while editing an item it should attempt to save it. This works fine, but only when you're within the Domain or Username input. The event doesn't seem to get handled when you're in the Password input. Pressing Enter does nothing, which is unfortunate, since it's - understandably - the last input the user will normally edit. Is this because the input has the type='password' attribute or what could be the reason it's not reacting to the Enter keypress? Is there another control/input we should be using?

    Regards,

    Steve.

  2. Answer
    Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 06 Jan Link to this post

    Hi Steve,

    We will check if the problem is related to the ListView or not. Meanwhile, you can try attaching a custom handler for the keyup event to the password input, e.g.:

    // get a reference to the ListView
    var listView = $('#list-view-element-id').data('kendoListView');

    // call the widget's save() method on Enter in the password input element
    $('#password-input-id').keyup(function(ev){
          if(ev.keyCode === 13){
            listView.save();
          }
        });

    Regards,
    Dimiter Topalov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 06 Jan Link to this post

    Hello Steve,

    Just a quick follow-up on the Enter keypress issue:

    - it is really a problem inside the ListView and has been fixed. Changes will take effect in the Q1 2016 release, due next week.

    - the keyup handler, suggested previously, should be attached in the ListView's edit event. Before that the password textbox does not exist.

    http://docs.telerik.com/kendo-ui/api/javascript/ui/listview#events-edit

    You can use kendo.keys.ENTER instead of 13. Special key codes are documented at:

    http://docs.telerik.com/kendo-ui/api/javascript/kendo#fields-keys

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Steve
    Steve avatar
    17 posts
    Member since:
    Oct 2014

    Posted 07 Jan in reply to Dimo Link to this post

    Hi Dimiter & Dimo,

    thanks for your workaround, binding it during the edit event was the crucial point. This seems to work as intented.

    I'm looking forward to the Q1 2016 release where this'll be fixed, since the workaround is not optimal for us because we're using MVVM, so getting DOM elements with JQuery is not really best practice :)

    But until the fix is live, this'll do!

    Regards,

    Steve.

Back to Top
Kendo UI is VS 2017 Ready