I have this block with pagination:

        protected function _prepareLayout()

            if ($this->getItem()) {
                $pager = $this->getLayout()->createBlock(

                $this->setChild('pager', $pager);

            return $this;

        public function getItem()
$obj = \Magento\Framework\App\ObjectManager::getInstance();
            $attributeSetCollectionFactory = $obj->get('Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory');
            /** @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\Collection $attributeSetCollection */
            $attributeSetCollection = $attributeSetCollectionFactory->create();
            $attributeSets = $attributeSetCollection->getItems();

            return $attributeSetCollection;

        public function getPagerHtml()
            return $this->getChildHtml('pager');


And in my template I have this under the table:

 <?php if ($block->getPagerHtml()): ?>
        <div class="order-products-toolbar toolbar bottom"><?php echo $block->getPagerHtml(); ?></div>
    <?php endif ?>


I have 18 items in my table, but I set to show only 10 per page, but, nothings happen, the page reload, but continue showing 10. what I'm doing wrong?

EDIT: I remove the set size and continue the same issue

  • I think you should remove this $attributeSetCollection->setPageSize($pageSize); $attributeSetCollection->setCurPage($page); from your getItem method and let the pagination work it's magic. – Marius Feb 20 '19 at 12:22
  • i removed, and run cache flush and clean, and continue the same, and i dont understand why :( – FlávioD Feb 20 '19 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.