修改BUG:Longbow.DataEntity组件保存按钮删除更新表格逻辑,直接从服务器重新获取数据

This commit is contained in:
Argo-MacBookPro 2018-10-29 10:09:55 +08:00
parent 45707d7ee8
commit fbf02552f1
2 changed files with 2 additions and 42 deletions

View File

@ -161,28 +161,8 @@
url: options.url, data: options.data, title: "保存数据", modal: options.modal, method: "post",
callback: function (result) {
if (result) {
var finalData = null;
var index = 0;
if (result) {
if (options.bootstrapTable.constructor === String && options.data.Id.constructor === String) {
// 更新表格
if (options.data.Id > 0) {
var allTableData = $(options.bootstrapTable).bootstrapTable('getData');
for (index = 0; index < allTableData.length; index++) {
finalData = allTableData[index];
if (finalData.Id === options.data.Id) {
break;
}
}
}
else {
$(options.bootstrapTable).bootstrapTable('refresh');
finalData = options.data;
}
}
}
$(options.bootstrapTable).bootstrapTable('refresh');
handlerCallback.call(that, null, element, { oper: 'save', success: result, index: index, data: finalData });
handlerCallback.call(that, null, element, { oper: 'save', success: result, data: options.data });
}
}
});

View File

@ -161,28 +161,8 @@
url: options.url, data: options.data, title: "保存数据", modal: options.modal, method: "post",
callback: function (result) {
if (result) {
var finalData = null;
var index = 0;
if (result) {
if (options.bootstrapTable.constructor === String && options.data.Id.constructor === String) {
// 更新表格
if (options.data.Id > 0) {
var allTableData = $(options.bootstrapTable).bootstrapTable('getData');
for (index = 0; index < allTableData.length; index++) {
finalData = allTableData[index];
if (finalData.Id === options.data.Id) {
break;
}
}
}
else {
$(options.bootstrapTable).bootstrapTable('refresh');
finalData = options.data;
}
}
}
$(options.bootstrapTable).bootstrapTable('refresh');
handlerCallback.call(that, null, element, { oper: 'save', success: result, index: index, data: finalData });
handlerCallback.call(that, null, element, { oper: 'save', success: result, data: options.data });
}
}
});