web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Hide List View Page Li...
Power Pages
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!

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    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();

     

  • hwu Profile Picture
    21 on at

    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,482 Most Valuable Professional on at

    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

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

  • Verified answer
    oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    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

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

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 42

#2
omkarsupreme Profile Picture

omkarsupreme 24

#3
Valantis Profile Picture

Valantis 22

Last 30 days Overall leaderboard