I have a combobox populated from a database table. It has values like A1,A2,A3,C1,C2,C3,S1,S2,S3, etc. The user wants to be able to press a letter key (A,C,S, etc.) and have it jump to the first value beginning with that letter. By using this code I am able to get it to select that value. The problem is that if the value is not in the visible portion of the list, it won't scroll to that value to make it visible. Is there a way to do that?
$('#selOrthotic').combobox('textbox').bind('keypress', (function(e) {
var k=String.fromCharCode(e.which).toUpperCase();
for (c of $('#selOrthotic').combobox('getData')) {
// 'code' is the database field name of the value field
if (c.code.slice(0,1)==k) {
$('#selOrthotic').combobox('select', c.code);
break;
}
}
}))