... exportAction(int $id, string $type, ?array $params = []): ?BFile
{
try {
$file = \Bitrix\Main\Engine\Response\BFile::createByFileId(985);
} catch (\Throwable $th) {
$this->addError(new Error($th->getMessage(), $th->getCode()));
}
return $file;
}
JSBX.ajax.runComponentAction('company:sale.basket.detail', 'export', {
mode: 'ajax',
data: {id, type},
method: 'POST',
})
?.then(response => {
if (response.status === 'success' && response.data?.url) {
window.location.href = response....
12.10.2023 14:55:07
....xls';
\file_put_contents($pFilename, $data);
$arFile = \CFile::MakeFileArray($pFilename, false, true);
$file = new BFile($arFile);
} catch (\Throwable $th) {
$this->addError(new Error($th->getMessage(), $th->getCode()));
}
return $file;
}
JSBX.ajax.runComponentAction('company:sale.basket.detail', 'export', {
mode: 'ajax',
data: {id, type},
method: 'POST',
})
?.then(response => {
if (response.status === 'success' && response.data?.url) {
window.location.href = response....
12.10.2023 14:55:07
Отсортировано по релевантности | Сортировать по дате