* Implements unlink stakeholder on the stakeholder list page within program module.
This commit is contained in:
@@ -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(',')));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user