list - 是否有一个简单的解决方案来导出过滤的后端列表
问题描述
我有一个包含产品和位置的列表。我创建了一个过滤器定义,可以根据位置过滤产品。现在我想导出过滤后的选择以将其打印为 pdf。
我尝试使用 ajax 框架访问过滤后的项目,但找不到任何有关如何检索过滤后的 id 的信息。
我的 printhandler 工作正常,我只需要在过滤器中获取所选项目的 ID。
范围:
location:
label: Location
modelClass: XXX\xxxx\Models\Location
conditions: location_id in (:filtered)
nameFrom: location
解决方案
与往常一样,在寻求解决方案后找到了解决方案;
找到一段代码:
function getCurrentFilters() {
$filters = [];
foreach (\Session::get('widget', []) as $name => $item) {
if (str_contains($name, 'Filter')) {
$filter = @unserialize(@base64_decode($item));
if ($filter) {
//$filters[] = $filter;
array_push($filters, $filter);
}
}
}
return $filters;
}
推荐阅读
- .net - Post 对象为空 - 角度,.NET Core
- rdf - 像 Protege 这样的 RDF 开发工具?
- html - 如何在不移动文档右侧的元素的情况下将元素的宽度增加到最大值
- mysql - MySQL 克隆匹配行并修改一个具有唯一 PHP 生成值的字段
- javascript - 我如何从循环中获取数组?
- python - 平面线交点
- mongodb - 从 mongo 获取日期时间并将其推送到数组
- sql - How to get row count based on other column groups
- reporting-services - SSRS 报告未正确抑制空白
- python - 如何在 ubuntu 启动时使用终端窗口启动 python 程序