Ad

How To Catch Pagination Element Of Shopify Api With Jquery

enter image description here

How to enable any of the pagination button by clicking on my ajax request.

Scenario: In my shopify app, I have a checkbox on which I am sending a ajax request and in response I want to enable this button.

Tried: I have tried some solutions mentioned in stackoverflow but couldn't work.

Here: window.parent.document this raise error for permission denied.

Ad

Answer

You can call the same code of shopify pagination in the ajax response. So it will take your changed pagination value and enable the pagination buttons.

ShopifyApp.ready(function(){
  ShopifyApp.Bar.initialize({
    title: window.mainPageTitle,
    icon: '/icon20x20.png',

    pagination: {
      previous: {href: "/start?page=1"},
      next: {href: "/start?page=3"}
    }
  });
});
Ad
source: stackoverflow.com
Ad