这个在后面两个备注,和备注人控件,编辑结束后或者编辑事件写js,编辑了,就给备注事件设置当前时间
例如comment单元格控价,js如下
Date.prototype.Format = function (fmt) { // author: meizz
var o = {
"M+": this.getMonth() + 1, // 月份
"d+": this.getDate(), // 日
"h+": this.getHours(), // 小时
"m+": this.getMinutes(), // 分
"s+": this.getSeconds(), // 秒
"q+": Math.floor((this.getMonth() + 3) / 3), // 季度
"S": this.getMilliseconds() // 毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
var a = this.getValue();
var location = this.options.location; //获取当前控件的位置
var cr = FR.cellStr2ColumnRow(location);
var col = cr.col; //列号
var ro = cr.row; //行号
if (a == '1') {
//var myDate = new Date();
var b=new Date().Format("yyyy-MM-dd hh:mm:ss");
// 获取日期与时间
contentPane.setCellValue(0, col-1, ro, b);//给前面一列单元格赋值
}
==========
如果在后面一列,最后的
contentPane.setCellValue(0, col-1, ro, b);//给前面一列单元格赋值
改成
contentPane.setCellValue(0, col-2, ro, b);//给前面两列单元格赋值