Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Customize & Extend
Answered

Hide List View Page Links and Show When Search Is Done

(0) ShareShare
ReportReport
Posted on by 21

Hi. I created a list view and there are page links at the bottom. I want to hide the page links when the list is loaded but show the page links when the search is conducted. I am using the hide() function within the list.on("loaded", function () {}) and I have a show() function within the list.on("loaded", function () {}) but on click of the search button. But because the list gets loaded again after the search button is clicked and rehides the page links without showing them. How can I hide the page links and show them on the click of the search button? Thanks!

  • hwu Profile Picture
    21 on at
    Re: Hide List View Page Links and Show When Search Is Done

    Thanks Oliver! This is exactly what I was looking for.

  • Verified answer
    oliver.rodrigues Profile Picture
    9,319 Most Valuable Professional on at
    Re: Hide List View Page Links and Show When Search Is Done

    Hi, I came up with a simpler version of the code that should work fine, see if that's what you need:

    let firstLoad = true;
    
    $(document).ready(function () {
    
     var list = $(".entitylist.entity-grid").eq(0);
    
     list.on("loaded", function () {
    
     if (firstLoad) {
     $(".view-grid").hide();
     $(".view-pagination").hide();
     }
     else {
     $(".view-grid").show();
     $(".view-pagination").show();
     }
    
     firstLoad = false;
     })
    })

     

    I have an article on loading a large List as well that could be helpful: Power Apps Portals – Loading large data in Entity Lists – Oliver Rodrigues (oliverrodrigues365.com)

     

  • hwu Profile Picture
    21 on at
    Re: Hide List View Page Links and Show When Search Is Done

    Hi Oliver. I just tried the code you provided and the page links are still showing.

  • oliver.rodrigues Profile Picture
    9,319 Most Valuable Professional on at
    Re: Hide List View Page Links and Show When Search Is Done

    Seems that you are doing quite a lot in your code, all you need is to use the .view-pagination class that I mentioned previously 

    I didn't test the code, but something like this:

    $(document).ready(function () {
    
     var list = $(".entitylist.entity-grid").eq(0);
     //this hides the list so that the javascript will run before the page renders
    
     $(".view-grid").hide();
     $(".view-pagination").hide();
    
     list.on("loaded", function () {
    
     //once the list is loaded, then show the list after the javascript ran. User needs to click on search button to populate list of records and also the page links
     $(".btn.btn-default.btn-hg").click(function(){
     $(".view-grid").show();
     $(".view-pagination").show();
     console.log('Test2');
     });
     })
    })
    
  • hwu Profile Picture
    21 on at
    Re: Hide List View Page Links and Show When Search Is Done

    Hi Oliver. Here is the code on the attachment and also some screenshots. I am able to hide the page links successfully but I can't show them again after clicking on the search button. The page links remain hidden but I want them to show again.

  • oliver.rodrigues Profile Picture
    9,319 Most Valuable Professional on at
    Re: Hide List View Page Links and Show When Search Is Done

    Hi. can you share the code that you are using to hide the table? you need to hide both the table and the pagination in your scenario, for example:

    $(".view-grid").hide();
    $(".view-pagination").hide();

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43

Featured topics