Recently used Easyui to make a drop-down box, after entering a value fuzzy query according to a value:
$ (' #comboboxA '). ComboBox ({
url:basepath+ ' Form/formlistforcombobox ',
Method: ' Get ',
Valuefield: ' FormId ',
TextField: ' Formdisplayname ',
PANELHEIGHT:200,
Multiple:false,
Keyhandler: {
Up:function (e) {//"Up ARROW" to defer processing
},
Down:function (e) {//"down arrow" to defer processing
},
Enter:function (e) {//"enter" to defer processing
var Inputtext = $ (' #comboboxA '). ComboBox (' GetText ');
var url = basepath+ ' form/searchformlist ' + '? inputtext= ' + Inputtext;
$ (' #comboboxA '). ComboBox (' reload ', url);
$ (' #comboboxA '). ComboBox (' SetValue ', inputtext);
/*$.ajax ({
Type: ' Post ',
url:basepath+ ' Form/searchformlist ',
data:{' Inputtext ': Inputtext},
DataType: ' JSON ',
Success:function (formoptionlist) {
Console.log (formoptionlist);
},
Error:function (Result) {
if (Result! = ' null ' && result! = ') {
$.messager.alert ("Hint", "An unknown error has occurred!") ");
}
}
});*/
},
Query:function (keyword) {//"Dynamic Search" processing
}
}
});
where the var url = basepath+ ' form/searchformlist ' + '? inputtext= ' + Inputtext;
This line uses the Get method to pass the parameter (the URL is followed directly by the argument is get, the parameter is placed in the data{"Inputtext": "Inputtext"} for the Post method).
And if you do not configure about 64 rows of Servers\tomcat v7.0 Server at Localhost-config\server.xml:
<connector uriencoding= "UTF-8" connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443"/ The > will appear garbled in Chinese.
This garbled language also has a solution:
JS: var url = basepath+ ' form/searchformlist ' + '? inputtext= ' + encodeURI (inputtext, "UTF-8");
Controller: String inputtextval = new String (Inputtext.getbytes ("iso-8859-1"), "UTF-8");
However, the first method is more recommended, directly in the configuration of the convenience.
JS in the URL to pass the Chinese characters garbled