I
I
itemashabanov2021-03-23 14:26:27
1C-Bitrix
itemashabanov, 2021-03-23 14:26:27

How to make a selection by element ID in a component call?

Hello. I use Ajax to pass an array with element IDs to the component call, but, for some reason, all elements of the infoblock are displayed, and not just those whose IDs I specified. An array is being passed. Even if I explicitly specify the IDs that I need, all are still displayed. What am I doing wrong?

"FILTER_NAME" => Array("IBLOCK_ID" => 121, "ID" => $_GET["elementsArray"], "CREATED_BY" => $userID)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2021-03-23
@itemashabanov

"FILTER_NAME" is the name of the global variable with the filter, not the filter itself.
global $arrFilter;
$arrFilter = Array("IBLOCK_ID" => 121, "ID" => $_GET["elementsArray"], "CREATED_BY" => $userID);
"FILTER_NAME" => "arrFilter"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question