databox在edatagrid中设备默认值的问题

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta charset="UTF-8">
	<title>Cache Editor for DataGrid - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../jquery.edatagrid.js"></script>
    <script type="text/javascript" src="../../jquery.edatagrid.js"></script>
    <script type="text/javascript" src="../../easyui-lang-zh_CN.js"></script>
</head>
<body>
<table id="dg"></table>
<script>
var data2={"total":4,"rows":[
{"filedid":"w1iRaEZjvz8iESYa","a":"第26周(6.25~26)","b":"黄123","qgdate1":"2016/06/25","qgdate2":"2016-06-26"},
{"filedid":"HyzIqJMCKym0DuIx","a":"第25周(6.18~19)","b":"周456","qgdate1":"2016/06/18","qgdate2":"2016-06-19"},
{"filedid":"hNSe07WVKftJDza8","a":"端午节(6.9~11)","b":"粟789","qgdate1":"2016/06/09","qgdate2":"2016-06-11"},
{"filedid":"iDUxrBdDzPf4BOTm","a":"第23周(6.4~6.5)","b":"谢1011","qgdate1":"2016/06/04","qgdate2":"2016-06-05"}
]}
		$('#dg').edatagrid({ url:'',
		data:data2,
		height:"400px", width:"600px",
		frozenColumns:[[    
           { field: "a", title: "值班标题", width: 130, editor: "text" },
           { field: "qgdate1", title: "开始时间", width: 80, align:"right", editor: "datebox" },
           { field: "qgdate2", title: "结束时间", width: 80, align: "right",  editor: "datebox"},

        ]], 
        columns: [[
        { field: "filedid", title: "系统识别号", width: 100,hidden:true},
         { field: "b", title: "公司导", width: 80, editor: "text" },


]]
 });
 
 $.extend($.fn.datagrid.defaults.editors, {
  datebox : {
    init : function(container, options) {
      var input = $('<input type="text">').appendTo(container);
      input.datebox(options);
      return input;
    },
    destroy : function(target) {
      $(target).datebox('destroy');
    },
    getValue : function(target) {
      return $(target).datebox('getValue');//获得旧值
    },
    setValue : function(target, value) {
      console.info(value);
      $(target).datebox('setValue', value);//设置新值的日期格式
    },
    resize : function(target, width) {
      $(target).datebox('resize', width);
    }
  }
});
       </script>
</body>
</html>

要使用databox中的日期与datagrid中的日期一致,必须要求这两个日期的格式一致,如果不一致,将无法取到,如“2016-6-24” 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值