* Fix bug for batch unlink stakeholder.
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
window.onClickBatchUnlink = function(event)
|
||||
$(document).off('click', '.batch-unlink').on('click', '.batch-unlink', function()
|
||||
{
|
||||
zui.Modal
|
||||
.confirm({message: confirmBatchUnlinkTip, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'})
|
||||
.then((confirmed) =>
|
||||
{
|
||||
if(confirmed)
|
||||
{
|
||||
const dtable = zui.DTable.query($(this).target);
|
||||
const checkedList = dtable.$.getChecks();
|
||||
if(!checkedList.length) return;
|
||||
const dtable = zui.DTable.query($(this).target);
|
||||
const checkedList = dtable.$.getChecks();
|
||||
if(!checkedList.length) return;
|
||||
|
||||
const url = $(this).closest('button').data('url');
|
||||
const form = new FormData();
|
||||
checkedList.forEach((id) => form.append('stakeholderIdList[]', id));
|
||||
const url = $(this).data('url');
|
||||
const form = new FormData();
|
||||
checkedList.forEach((id) => form.append('stakeholderIdList[]', id));
|
||||
|
||||
$.ajaxSubmit({url, data: form});
|
||||
}
|
||||
});
|
||||
}
|
||||
zui.Modal.confirm({message: confirmBatchUnlinkTip, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((confirmed) =>
|
||||
{
|
||||
if(confirmed) $.ajaxSubmit({url, data: form});
|
||||
})
|
||||
});
|
||||
|
||||
@@ -95,8 +95,7 @@ dtable
|
||||
'items' => array(array
|
||||
(
|
||||
'text' => $lang->unlink,
|
||||
'class' => 'btn secondary toolbar-item batch-btn size-sm ajax-submit',
|
||||
'onClick' => jsRaw('onClickBatchUnlink'),
|
||||
'class' => 'btn primary batch-unlink',
|
||||
'data-url' => createLink('program', 'batchUnlinkStakeholders', "programID={$programID}")
|
||||
))
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user