1、easyui的datebox怎么禁止手动输入?
<input type="text" class="easyui-datebox" editable="false" id="birthday">
2、easyui怎么获取datebox的值?
<script src="jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
<script type="text/javascript">
var birth = $("#birthday").datebox("getValue");
alert(birth);
</script>
3、easyui的datebox转换显示格式?例:11//11/2017→→→→2017-11-11
<script src="jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
4、easyui的form提交前先做验证
// 提交之前先判断所有输入框是否都验证通过
var isValid = $("#oldBasicInfo-form").form('validate');// 验证表单中的一些控件的值是否填写正确
if (!isValid) {
return false;
}
5、easyui的required属性无法判断空格
1.修改jquery.easyui.min.js:(增加$.trim())
if(opts.required){
if($.trim(opts.val(_4a0))==""){
_4a4(opts.missingMessage);
return false;
}
2.自定义validate.js
isBlank: {
validator: function (value, param) { return $.trim(value) != '' },
message: '不能为空,全空格也不行'
}
页面上每一个待检的数据都加上 data-options=“required:true,validType:'isBlank'”
6、判断datagrid有没有行被选中
var selectedRows = $('#res-dg').datagrid('getSelections');
if (selectedRows.length == 0) {//如果没有选中的数据
$.messager.alert("系统提示", "请选择一条要编辑的数据");//easyui的alert方法
return;
}