easyui combogrid onChanage 问题
来源:互联网 发布:淘宝账号申请及注册 编辑:程序博客网 时间:2024/05/16 19:49
easyui combogrid onChanage 输入中文的问题. 这里大家也可以讨论一下
就是输入中文的时候就触发了. 可不可以完全输入中文在触发.
方案: 1.延迟 -不行因为你不知道什么时候输入完成.
2.触发空格键触发 <输入中文的时候 -空格键.把中文输入到下拉框里>
3.回车键触发. <这些是方案都是避免onChanage问题
4.失去焦点触发.
5.判断输入的是否为中文
最终.中英文分开查询 两个下拉框. 网友么还有其他的办法么
1.
2.
/* $(function (){
$(document.body).keypress(function (e){
if(e.keyCode==16){
if (!$(e.target).is('input,textarea')){
$('#num')[0].focus();
}
}
}); */
3.回车
/* $(function (){
$(document.body).keypress(function (e){
if(e.keyCode==32){
if (!$(e.target).is('input,textarea')){
$('#num')[0].focus();
}
}
}); */
4. //失去焦点
/* $(document).ready(function() {
$('#cityHotelLine').next().find(":text").blur(function() {
//var ss=document.getElementById("#cityHotelLine").value;
// alert($('#cityHotelLine').next().find(":text"));
alert(1);
//获取下拉的值
alert('getValue:' + $('#cityHotelLine').combogrid('getValue'));
});
}); */
5. 判断是否中文/* onChange : function(newValue, oldValue) {
countryCodeCity = newValue;
var xignzi = '中国';
if (countryCodeCity != xignzi) {
if (/^[\u4e00-\u9fa5]+$/i.test(countryCodeCity)) {
alert("输入的是中文");
str = countryCodeCity.replace(/[^\x00-\xff]/g, 'xx'); 则长度提示为4.
if (str.length >= 4) {
alert("大于4个中文");
}
} else {
alert("英文");
}
}
} */
回车:
$("#cityHotelLine").combogrid().next('span').find('input').keyup(
function() {
//showKeyName(event);
if(event.keyCode==32){
var countryCodeCityy=$('#cityHotelLine').combogrid('getValue');
cityHotelLineL(countryCodeCityy);
}
});
$('#cityHotelLine').combobox('textbox').keyup(function (e) {
if(e.keyCode==13){
alert("回车");
}
});
function showKeyName(e) {
var keyName;
switch (e.keyCode) {
case 32:
alert("空格");
break;
default:
/* keyName = e.keyCode + "[" + String.fromCharCode(e.keyCode)
+ "]"; */
alert(1);
break;
}
return keyName;
}
乱码问题. easyui combogrid URL提交到后台乱码问题
HttpServletRequest request=ServletActionContext.getRequest();
request.setCharacterEncoding("UTF-8");
String countryCodeCity=request.getParameter("countryCodeCity");
//countryCodeCity= java.net.URLDecoder.decode(countryCodeCity,"UTF-8");
//String countryCodeCity=new String(new String(request.getParameter("countryCodeCity").getBytes("ISO-8859-1"),"UTF-8"));
注释的可以.
- easyui combogrid onChanage 问题
- easyUI ComboGrid
- easyui ComboGrid
- easyui的combogrid自动选中问题
- easyui 过滤ComboGrid
- easyui combogrid 的查询
- easyUI学习笔记-----combogrid
- EasyUI中的combogrid
- EasyUI Combogrid的使用
- Jquery EasyUI使用ComboGrid
- easyUI easyui-combobox 和 easyui-combogrid 用法
- EasyUI中combogrid的使用方法
- EasyUI中combogrid的使用方法
- EasyUI combogrid 用法(带搜索)
- EasyUI中combogrid的使用方法
- jQuery-easyUI的使用:combogrid
- Easyui中combogrid设置默认值
- jQuery EasyUI 1.3.6 form中的<label for="...">对于combogrid不起作用的问题修正
- 阻塞与非阻塞 同步与异步
- 数据建模
- zookeeper之实践一
- 二叉树操作
- 大众点评的大数据实践
- easyui combogrid onChanage 问题
- phpcms定时发布文章解决办法
- 条件编译
- 我的Java开发学习之旅------>Java经典排序算法之归并排序
- 试试 ECMAScript 6
- Android Superuser 提权漏洞分析
- 集中化运维管理——Puppet管理之路
- hdoj1421 搬寝室(基础DP)
- WCF webhttprequest usage