主子表示例添加日期格式案例

This commit is contained in:
RuoYi
2020-08-11 17:34:10 +08:00
parent cdbf0e2264
commit a0ada99856
3 changed files with 39 additions and 1 deletions

View File

@ -119,6 +119,15 @@
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='goods[%s].weight' value='%s'>", index, value);
return html;
}
},
{
field: 'date',
align: 'center',
title: '商品日期',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='goods[%s].date' value='%s' placeholder='yyyy-MM-dd'>", index, value);
return html;
}
},
{
@ -155,6 +164,15 @@
autoclose: true
});
function bindDatetimepicker() {
$("input[name$='date']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
pickerPosition:'top-right'
});
}
function addColumn() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
sub.editColumn();
@ -166,9 +184,12 @@
name: "",
weight: "",
price: "",
date: "",
type: "",
}
});
bindDatetimepicker();
}
</script>
</body>