* Implements unlink stakeholder on the stakeholder list page within program module.

This commit is contained in:
chentao
2023-06-29 17:18:53 +08:00
parent 48b3b14fd2
commit ffd7ff3615
3 changed files with 54 additions and 36 deletions
+24 -5
View File
@@ -1,9 +1,28 @@
window.footerGenerator = function()
window.unlinkStakeholderConfirm = function(confirmDeleteTip, actionUrl)
{
const dtable = zui.DTable.query($(this).target);
zui.Modal
.confirm({message: confirmDeleteTip, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'})
.then((confirmed) =>
{
if(confirmed) $.ajaxSubmit({url: actionUrl});
});
};
window.onClickBatchUnlink = function(event)
{
const dtable = zui.DTable.query(event.target);
const checkedList = dtable.$.getChecks();
const statistic = summeryTpl.replace('%s', ' ' + checkedList.length + ' ');
return [{children: statistic, className: "text-dark"}, "flex", "pager"];
}
if(checkedList.length === 0) return;
/* Generate checked stakeholder ID list string. */
let idList = new Array();
checkedList.forEach(function(id)
{
idList.push(id);
});
/* Set data-url for ajaxSubmit. */
const button = $($(event.target).parents('button'));
button.data('url', button.data('href').replace('%s', idList.join(',')));
}