D
D
Diversia2018-02-01 13:02:09
1C-Bitrix
Diversia, 2018-02-01 13:02:09

Where to specify template name for pagination in highloadblock?

use Bitrix\Highloadblock\HighloadBlockTable as HLBT;
use Bitrix\Main\Loader; 

Loader::includeModule("highloadblock"); 

function GetEntityDataClass($HlBlockId) {
    if (empty($HlBlockId) || $HlBlockId < 1)
    {
        return false;
    }
    $hlblock = HLBT::getById($HlBlockId)->fetch();   
    $entity = HLBT::compileEntity($hlblock);
    $entity_data_class = $entity->getDataClass();
    return $entity_data_class;
}
 
$count_notice=20;
$id_hl_block=1;
 
$nav = new \Bitrix\Main\UI\PageNavigation('page');
$nav->allowAllRecords(true)
   ->setPageSize($count_notice)
   ->initFromUri();

$entity_data_class = GetEntityDataClass($id_hl_block);
$rsData = $entity_data_class::getList(array(
   'select' => array('*'),  
    "count_total" => true,
      "offset" => $nav->getOffset(), 
      "limit" => $nav->getLimit(), 
    'filter' => $arFilter, 
    "order" => array("ID"=>"DESC")
));
 
$nav->setRecordCount($rsData->getCount());
while($el = $rsData->fetch()){ 
  ?>
  <div class="block_notice">
    <?php echo $el['UF_DETAIL'];  ?> |
    <?php echo $el['UF_PRICE'];  ?> |
    <?php echo $el['UF_OBJECT'];  ?> |
    <?php echo $el['UF_TYPE'];  ?>
  </div>	
  <?php
}
$APPLICATION->IncludeComponent("bitrix:main.pagenavigation", "", Array(
  "NAV_OBJECT" => $nav,
  "SEF_MODE" => "N",
  "SHOW_COUNT" => "N"
  ),
  false
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2019-05-04
@Diversia

$nav = new \Bitrix\Main\UI\PageNavigation('page');
PAGE!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question