EasyUI Forum
May 16, 2024, 12:03:41 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combogrid (combo) doesn't recognize barcode scanner input  (Read 5665 times)
phreeman
Newbie
*
Posts: 8


View Profile
« on: June 18, 2015, 03:07:54 PM »

I have a form with an editable datagrid (edatagrid) that uses a combogrid as an editor. I can type from my keyboard into the combogrid but when I enter data through a barcode scanner, there is no response.

I can successfully read the barcode input through a datagrid editor of type text on the same row but not for the combogrid. I also tried a combogrid outside the editable datagrid with no luck. Regular, non-easyui, fields in the form also work properly. I'm thinking the combo is looking for a keypress event that it may not be receiving from the barcode scanner. What I'm trying to do is automatically fill the datagrid row resulting from a scan of a product barcode.

Any ideas?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 18, 2015, 06:44:25 PM »

When enter something on the combogrid's textbox and then press ENTER key, the combogrid will check the entered value to see if it is exists in the drop-down list. If the entered value does not match the list items, it will be cleared.

The barcode scanner may add a ENTER key to the end of inputed value, to solve this issue, please try to override the 'enter' key handler for your combogrid component.

Code:
$('#cc').combogrid({
keyHandler: $.extend({}, $.fn.combogrid.defaults.keyHandler, {
enter: function(e){
//...
}
})
})
Logged
phreeman
Newbie
*
Posts: 8


View Profile
« Reply #2 on: June 19, 2015, 08:13:24 AM »

You are exactly correct. I bought a cheap barcode scanner and the default was to send the CR character at the end of the barcode. Once I disabled the termination character, everything worked as expected. Funny as I had a Symbol barcode scanner and they don not send the CR character, everything work as expected out of the box.

Thanks for your help.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!