Это код связки таблицы с фильтром , все выводиться , пагинация работает , но не работает фильтр ( я пишу имя , но он не ищет , просто таблица пустая ) , хотя по запросу значение он берет , кто сталкивался и делал что то подобное , помогите пожалуйста
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Список заданий бизнес процессов");
use \Bitrix\Iblock\PropertyEnumerationTable;
use Bitrix\Main\Grid\Options as GridOptions;
use Bitrix\Main\UI\PageNavigation;
CModule::IncludeModule("bizproc");
$list_id = 'report_list';
$grid_options = new GridOptions($list_id);
$sort = $grid_options->GetSorting(['sort' => ['NAME' => 'DESC'], 'vars' => ['by' => 'by', 'order' => 'order']]);
$nav_params = $grid_options->GetNavParams();
$nav = new PageNavigation('report_list');
$nav->allowAllRecords(true)
->setPageSize($nav_params['nPageSize'])
->initFromUri();
if ($nav->allRecordsShown()) {
$nav_params = false;
} else {
$nav_params['iNumPage'] = $nav->getCurrentPage();
}
$ui_filter = [
['id' => 'NAME', 'name' => 'Название', 'type'=>'text', 'default' => true],
];
$filterOption = new Bitrix\Main\UI\Filter\Options($list_id);
$filterData = $filterOption->getFilter([]);
foreach ($filterData as $k => $v) {
$filterData['NAME'] = "%".$filterData['FIND']."%";
}
$APPLICATION->IncludeComponent('bitrix:main.ui.filter', '', [
'FILTER_ID' => 'report_list',
'GRID_ID' => 'report_list',
'FILTER' => $ui_filter,
'ENABLE_LIVE_SEARCH' => true,
'ENABLE_LABEL' => true
]);
$filterData['ACTIVE'] = "Y";
$columns = [];
$columns[] = ['id' => 'ID', 'name' => 'ID', 'sort' => 'ID', 'default' => true];
$columns[] = ['id' => 'NAME', 'name' => 'Название', 'sort' => 'NAME', 'default' => true];
$res = CBPTaskService::getList($sort['sort'], $filterData, false, $nav_params,
["ID", "WORKFLOW_ID","MODIFIED", "OVERDUE_DATE", "NAME","WORKFLOW_TEMPLATE_NAME","WORKFLOW_STARTED_BY","WORKFLOW_STARTED","DOCUMENT_NAME" ,"PARAMETERS"]
);
$nav->setRecordCount($res->selectedRowsCount());
while($row = $res->GetNext()) {
$user = $row["WORKFLOW_STARTED_BY"];
$rsUser = CUser::GetByID($user);
$arUser = $rsUser->Fetch();
$full_name = $arUser['NAME'].' '.$arUser['LAST_NAME'];
$list[] = [
'data' => [
"ID" => $row['ID'],
"NAME" => $full_name,
],
'actions' => [
[
'text' => 'Просмотр',
'default' => true,
'onclick' => 'document.location.href="?op=view&id='.$row['ID'].'"'
], [
'text' => 'Удалить',
'default' => true,
'onclick' => 'if(confirm("Точно?")){document.location.href="?op=delete&id='.$row['ID'].'"}'
]
]
];
}
$APPLICATION->IncludeComponent('bitrix:main.ui.grid', '', [
'GRID_ID' => $list_id,
'COLUMNS' => $columns,
'ROWS' => $list,
'SHOW_ROW_CHECKBOXES' => false,
'NAV_OBJECT' => $nav,
'AJAX_MODE' => 'Y',
'AJAX_ID' => \CAjax::getComponentID('bitrix:main.ui.grid', '.default', ''),
'PAGE_SIZES' => [
['NAME' => "5", 'VALUE' => '5'],
['NAME' => '10', 'VALUE' => '10'],
['NAME' => '20', 'VALUE' => '20'],
['NAME' => '50', 'VALUE' => '50'],
['NAME' => '100', 'VALUE' => '100']
],
'AJAX_OPTION_JUMP' => 'N',
"AJAX_OPTION_STYLE" =>"Y",
'SHOW_CHECK_ALL_CHECKBOXES' => false,
'SHOW_ROW_ACTIONS_MENU' => true,
'SHOW_GRID_SETTINGS_MENU' => true,
'SHOW_NAVIGATION_PANEL' => true,
'SHOW_PAGINATION' => true,
'SHOW_SELECTED_COUNTER' => true,
'SHOW_TOTAL_COUNTER' => true,
'SHOW_PAGESIZE' => true,
'SHOW_ACTION_PANEL' => true,
'ALLOW_COLUMNS_SORT' => true,
'ALLOW_COLUMNS_RESIZE' => true,
'ALLOW_HORIZONTAL_SCROLL' => true,
'ALLOW_SORT' => true,
'ALLOW_PIN_HEADER' => true,
'TOTAL_ROWS_COUNT' => $nav->getRecordCount(),
'FILTER' => $filterData,
'AJAX_OPTION_HISTORY' => 'N'
]);