Ext.net Development Learning -- press ENTER event (6)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.