Ext. Net TextField Enter event, ext. nettextfield
(1) DirectEvents triggers the background
<Ext: TextField ID = "txt_Upc" runat = "server" Width = "150">
<DirectEvents>
<KeyPress OnEvent = "txtUpc_KeyPress">
<ExtraParams>
<Ext: Parameter Name = "keynum" Value = "e. getKey ()" Mode = "Raw"/>
</ExtraParams>
</KeyPress>
</DirectEvents>
</Ext: TextField>
CS Background:
Protected void txtUpc_KeyPress (object sender, DirectEventArgs e)
{
String key = e. ExtraParams ["keynum"]. ToString ();
If (key = "13 ")
{
// Do
}
}
(2) Listeners triggers the foreground
<Ext: TextField ID = "txt_Upc" runat = "server" Width = "150">
<Listeners>
<KeyPress Handler = "if (e. getKey () = Ext. EventObject. ENTER) {Ext.net. DirectMethods. TextKeyPress (); e. stopEvent ();}"/>
<SpecialKey Handler = "txtUpcEnter (e. getKey (), # {txt_Upc}. getValue ();"/>
</Listeners>
</Ext: TextField>
JS:
Function txtUpcEnter (keynum, value ){
If (keynum = "13 "){
}
}
(3) DirectMethods-trigger background
(In my personal experience, the DirectEvents method is unavailable when the scanner automatically enters the control, and the Listeners method is available to trigger the foreground)
<Ext: TextField ID = "txt_Upc" runat = "server" Width = "150">
<Listeners>
<KeyPress Handler = "if (e. getKey () = Ext. EventObject. ENTER) {Ext.net. DirectMethods. TextKeyPress (); e. stopEvent ();}"/>
<SpecialKey Handler = "Ext.net.DirectMethods.txt UpcEnter (e. getKey (), # {txt_Upc}. getValue ();"/>
</Listeners>
</Ext: TextField>
CS Background:
[DirectMethod]
Public void txtUpcEnter (string key, string value)
{
//
}