Answer the question
In order to leave comments, you need to log in
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
"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 questionAsk a Question
731 491 924 answers to any question