Answer the question
In order to leave comments, you need to log in
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"));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question