* Fix batch edit products in program product page.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Submit data to product batch edit page by html form while click on the batch edit button.
|
||||
*/
|
||||
window.onClickBatchEdit = function(event)
|
||||
{
|
||||
const checkedList = zui.DTable.query(event.target).$.getChecks();
|
||||
|
||||
if(!checkedList.length) return;
|
||||
|
||||
const formData = new FormData();
|
||||
checkedList.forEach(function(id)
|
||||
{
|
||||
formData.append('productIDList[]', id);
|
||||
});
|
||||
|
||||
postAndLoadPage($(event.target.closest('button')).data('url'), formData, '', {app: 'product'});
|
||||
};
|
||||
@@ -37,7 +37,18 @@ $products = initTableData($products, $cols, $this->product);
|
||||
foreach($products as $product) $data[] = $this->product->formatDataForList($product, $users, $usersAvatar);
|
||||
|
||||
$summary = sprintf($lang->product->pageSummary, count($data));
|
||||
$footToolbar = common::hasPriv('product', 'batchEdit') ? array('items' => array(array('text' => $lang->edit, 'class' => 'btn batch-btn size-sm primary', 'data-url' => $this->createLink('product', 'batchEdit', "programID={$programID}")))) : null;
|
||||
$footToolbar = common::hasPriv('product', 'batchEdit') ?
|
||||
array(
|
||||
'items' => array(
|
||||
array(
|
||||
'text' => $lang->edit,
|
||||
'class' => 'btn secondary toolbar-item size-sm',
|
||||
'data-url' => $this->createLink('product', 'batchEdit', "programID={$programID}"),
|
||||
'onClick' => jsRaw('window.onClickBatchEdit')
|
||||
)
|
||||
)
|
||||
) :
|
||||
null;
|
||||
|
||||
dtable
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user