Previously, I integrated "how to press ENTER Control for Multiple Input buttons on a page". Although it is a bit different, the truth is still similar! We have been playing with ext these days. Record what you have encountered ......
The page effect is as follows:
Front-endCode:
<Ext: formpanel id = " Formpanel3 " Border = " False " Runat = " Server " Padding =" 5 " Labelwidth = " 70 " >
<Items>
<Ext: compositefield id = " Compositefield3 " Runat = " Server " Fieldlabel =" Exact search " >
<Items>
<Ext: checkbox id = " Chkexactmatch " Runat = " Server " Fieldlabel = " Exact search " >
</Ext: checkbox>
</Items>
</Ext: compositefield>
<Ext: compositefield id = " Compositefield2 " Runat = " Server " Fieldlabel = " Search here " >
<Items>
<Ext: multicombo runat = " Server " Width = " 120 " Id = " Cobselect " Emptytext = " Search here " Selectionmode = " Checkbox " >
<Items>
<Ext: listitem text = " Employee ID " Value = " 1 " />
<Ext: listitem text = " Employee full name " Value = " 2 " />
<Ext: listitem text = " Employee English name " Value = " 3 " />
<Ext: listitem text = " Employee nickname " Value = " 4 " />
</Items>
</Ext: multicombo>
</Items>
</Ext: compositefield>
<Ext: compositefield id = " Compositefield1 " Anchorhorizontal = " 100% " Runat = " Server " Labelalign = " Top "
Fieldlabel = " Keywords " >
<Items>
<Ext: textfield id = " Txtkeyword " Emptytext = " Keywords " Labelalign = " Top " Runat = " Server " Width = " 120 " >
<Listeners>
<Specialkey fn = "txtkeyword_click"/>
</Listeners>
</Ext: textfield>
</Items>
</Ext: compositefield>
</Items>
</Ext: formpanel>
JS
///Keyword carriage return event
VaRTxtkeyword_click =Function(Field, e ){
If(E. getkey () = ext. eventobject. Enter ){
Ext.net. directmethods. btnsearch ();
}
}
Btnsearch background CS codeIs the button "Search" Method
// /<Summary>
// /Search Method
// /</Summary>
[Directmethod]
Public Void Btnsearch ()
{
# Region search by any of the following criteria
Stringbuilder sbsqlselect = New Stringbuilder ();
String strkeyword = txtkeyword. Text. tostring (). Trim ();
Bool ismatch = chkexactmatch. Checked; // exact search
Selectedlistitemcollection lists = cobselect. selecteditems;
................................................
................................................
................................................
................................................................................................
.................. N words are omitted here, which can be implemented as needed ..............................
}
View results
This is based on the employee's full name fuzzy search
Fuzzy carriage return query with the same employee ID
There must be more than one implementation method. If you have any friends in the garden, please let us know ......
Thank you.
End ............
author: Pepe
Source: http://pepe.cnblogs.com/
the copyright of this article is shared by the author and the blog Park. You are welcome to reprint it, but you must keep this statement without the author's consent, in The article page clearly shows the original article connection. Otherwise, the legal liability is retained.