I
I
itemashabanov2021-01-26 12:53:46
1C-Bitrix
itemashabanov, 2021-01-26 12:53:46

Pagination to a selection received via ajax?

Good day. There is a page with a news.list component with pagination syste,.pagenavigation, it has a self-written filter that sends a request via ajax, and in response receives the generated content and inserts it instead of the original selection and also replaces the navigation. Part of the handler file code for this:

$arSelect = Array("ID", "IBLOCK_ID", "CREATED_BY", "DATE_CREATE", "PREVIEW_TEXT", "DETAIL_TEXT", "PROPERTY_USER_ID", "PROPERTY_GOOD_REVIEW", "PROPERTY_NAME", "PROPERTY_RATING", "PROPERTY_USER_PROD_IMG", "PROPERTY_RE_REVIEW");

$arFilter = Array("IBLOCK_ID" => 61, "CODE" => $_POST["elementID"], "ACTIVE" => "Y", ">=PROPERTY_RATING" => $_POST["optionValue"]["stars"]);

$res = CIBlockElement::GetList(Array("DATE_CREATE" => $_POST["optionValue"]["beforeShow"]), $arFilter, false, false, array('ID'));
        
while($el = $res->Fetch()) {
  $arFilter['ID'][] = $el['ID'];
}

$res = CIBlockElement::GetList(Array("DATE_CREATE" => $_POST["optionValue"]["beforeShow"]), $arFilter, false, Array("nPageSize"=>2, "bShowAll"=> false), $arSelect);
$nav = $res->GetPageNavStringEx($navComponentObject, "", "reviews", "", "", array("BASE_LINK"=>$_SERVER["HTTP_REFERER"]."?sort"));


The question is: how to make pagination of filter results work? Because right now, the buttons lead to the results page of the initial selection, news.list.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-01-27
@itemashabanov

Answer in comments)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question