本帖最后由 小飞鼠 于 2021-10-8 11:19 编辑
功能实现日期带出,代码如下,第一段可以实现,但是第二段相同功能的代码实现不了,麻烦大佬帮我看看什么原因 1, function OnCellEndEdit(e) { //试用逻辑 var record = e.record, grid = e.sender, value = e.value, field = e.field; if (field == "begindate") { var sykstime = mini.parseDate(value); var sytimet = sykstime.getTime(); var sytimed = sykstime.getDate() - 1; var sytimem = sykstime.getMonth() + 4; var sytimey = sykstime.getFullYear(); var syzsj = sytimey + '-' + sytimem + '-' + sytimed; var syzsj = mini.parseDate(syzsj);//转换date var syzsj = syzsj.getTime(); //转换为time var syzsj = new Date(syzsj);//转换为date grid.updateRow(record, { enddate: syzsj }); } } 2, syqk.on("cellendedit", function (e) { var record = e.record, grid = e.sender, value = e.value, field = e.field; if (field == "begindate") { var sykstime = mini.parseDate(value); var sytimet = sykstime.getTime(); var sytimed = sykstime.getDate() - 1; var sytimem = sykstime.getMonth() + 4; var sytimey = sykstime.getFullYear(); var syzsj = sytimey + '-' + sytimem + '-' + sytimed; var syzsj = mini.parseDate(syzsj);//转换date var syzsj = syzsj.getTime(); //转换为time var syzsj = new Date(syzsj);//转换为date grid.updateRow(record, { enddate: syzsj }); } }) |