Created
September 9, 2014 05:29
-
-
Save zaunaf/6f234c5c93f0c95b120c to your computer and use it in GitHub Desktop.
Extjs 3 - Barcode Reader Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var barcodeWin = new Ext.Window({ | |
title: 'Scan Barcode', | |
width: 220, | |
height: 110, | |
//minWidth: 300, | |
//minHeight: 200, | |
layout: 'fit', | |
plain: true, | |
bodyStyle: 'padding:5px;', | |
buttonAlign: 'center', | |
closable: true, | |
items: new Ext.form.FormPanel({ | |
baseCls: 'x-plain', | |
url:'save-form.php', | |
labelWidth: 50, | |
defaultType: 'textfield', | |
items: [{ | |
name: 'sid', | |
xtype : 'hidden' | |
},{ | |
name: 'code', | |
id: 'barcodeField', | |
fieldLabel: 'Code', | |
anchor: '100%', | |
enableKeyEvents: true, | |
xtype: 'numberfield', | |
listeners: { | |
keypress : function(field, e) { | |
if (e.getKey() == Ext.EventObject.ENTER ) { | |
//Ext.Msg.alert('Barcode Reader','Isi Barcode : ' + field.getValue()); | |
spin.StoreSpp.reload({params:{sppid: field.getValue()}}); | |
gridPermohonanSpp.getSelectionModel().selectRow(0); | |
gridPermohonanSpp.fireEvent('rowclick', grid, 0); | |
barcodeWin.close(); | |
} | |
} | |
} | |
}] | |
}), | |
buttons: [{ | |
text: 'Batal', | |
iconCls: 'logout', | |
handler: function(thisbutton) { | |
barcodeWin.close(); | |
} | |
}] | |
}); | |
barcodeWin.show(); | |
barcodeField = Ext.getCmp('barcodeField'); | |
barcodeField.focus(true, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment