Easyui-combobox to implement simple auto-complement function example _javascript tips

Source: Internet
Author: User

Front desk:

HTML page

<input id= "Clsydw" name= "Clsydw" class= "Easyui-combobox" data-options= ""/> 

Js

/Auto Complement $ ("#clsydw"). ComboBox ({valuefield: ' Syr ', TextField: ' Syr ', 
        panelwidth:200, Panelheight: ' Auto ', onchange:function (values,o) {if (values!= "") { 
        var url= ' ${localctx}/workloadpmtreport/querysyr.do?syr= ' +values.trim (); 
      $ ("#clsydw"). ComboBox ("Reload", url);  The background section is the focus, because in the acceptance of SYR parameters, is garbled, here using a variety of decoding is not possible, only use the following decoding method (there may be a better way, not currently found)/** according to the name of the unit automatically complement the full unit of the full term * @param REQ * @return * * * @RequestMapping (value= "querysyr.do") @ResponseBody public list<veh_hy> Querylistsy 
    R (HttpServletRequest req) {String syr= ""; 
    try {syr=new string (new String (Req.getparameter ("Syr"). GetBytes ("Iso-8859-1"), "UTF-8"); 
    catch (Unsupportedencodingexception e) {e.printstacktrace (); } syr= (syr!= "")? 
    % ' +syr.trim () + '% ': "; 
  Return Vehhymapper.getlistbysyr (SYR); }

The above Easyui-combobox implementation of simple automatic completion of the full function of the example is a small series to share all the content, I hope to give you a reference, but also hope that we support the cloud-dwelling community.

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.