layui 可编辑表格 改为日期控件
this.equipmentTableOption = {
url: Feng.ctxPath + '/deviceCameraRemove/deviceCameraRemoveList?orderRemoveId=' + $('#orderRemoveId').val(),
elem: '#acceptanceEquipmentTable',
page: false,
limit: 1000,
cols: [[
{type: 'numbers', title: '序号'},
{
field: 'actualExpireDate',
title: '<i class="layui-icon layui-icon-edit" style="color:#000;">实际计费结束时间:',
minWidth: 100,
edit: true,
event: 'date' // 事件, 对应下面
},
{field: 'memo', title: '备注',}
]],
data: [],
response: {
statusCode: 200
}
};
table.on('tool(acceptanceEquipmentTable)',
function (d) {
var data = d.data;
var newdata = {};
switch (d.event) {
case "date":
var field = $(this).data('field');
laydate.render({
elem: this.firstChild // 固定写
, show: true //直接显示
, closeStop: this
, type: 'datetime'
, format: "yyyy-MM-dd HH:mm:ss"
, done: function (value, date) {
newdata[field] = value;
d.update(newdata);
}
});
break;
}
});