mirror of https://gitee.com/y_project/RuoYi.git
主子表操作添加通用addColumn方法
parent
59ad2b1d5e
commit
35a49e9462
|
@ -438,6 +438,16 @@ var sub = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#" + table.options.id).bootstrapTable('remove', { field: subColumn, values: ids });
|
$("#" + table.options.id).bootstrapTable('remove', { field: subColumn, values: ids });
|
||||||
|
},
|
||||||
|
addColumn: function(row, tableId) {
|
||||||
|
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||||
|
table.set(currentId);
|
||||||
|
var count = $("#" + currentId).bootstrapTable('getData').length;
|
||||||
|
sub.editColumn();
|
||||||
|
$("#" + currentId).bootstrapTable('insertRow', {
|
||||||
|
index: count + 1,
|
||||||
|
row: row
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -164,22 +164,15 @@
|
||||||
autoclose: true
|
autoclose: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function addColumn() {
|
function addColumn() {
|
||||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
var row = {
|
||||||
sub.editColumn();
|
name: "",
|
||||||
|
weight: "",
|
||||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
price: "",
|
||||||
index: count,
|
date: "",
|
||||||
row: {
|
type: "",
|
||||||
index: $.table.serialNumber(count),
|
}
|
||||||
name: "",
|
sub.addColumn(row);
|
||||||
weight: "",
|
|
||||||
price: "",
|
|
||||||
date: "",
|
|
||||||
type: "",
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#bootstrap-table").on("post-body.bs.table", function (e, args) {
|
$("#bootstrap-table").on("post-body.bs.table", function (e, args) {
|
||||||
|
|
Loading…
Reference in New Issue