This is a migrated thread and some comments may be shown as answers.

Confirm Edit/Create with Enter on Password-Input

3 Answers 163 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 04 Jan 2016, 08:00 AM

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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 06 Jan 2016, 12:46 PM
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!
 
0
Accepted
Dimo
Telerik team
answered on 06 Jan 2016, 01:21 PM
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!
0
Steve
Top achievements
Rank 1
answered on 07 Jan 2016, 10:25 AM

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.

Tags
ListView
Asked by
Steve
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Dimo
Telerik team
Steve
Top achievements
Rank 1
Share this question
or