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

Community site session details

Session Id : fOyllYMzWBoLGzFGbzo0LO
Power Pages - General Discussions
Unanswered

Filtered Lookup Modal keeps Empty paginated Pages

Like (0) ShareShare
ReportReport
Posted on 14 Feb 2023 14:00:06 by

I have used JS to create cascading filter from one lookup selection to another. However, after filtering the results keep the paginated pages and returns empty pages. Only the page that has results will show.

I have also turned off pagination by increasing the page size (2000), but this causes very long load times as all data needs to be filtered and then returned. 

 

Is there a way to remove empty pages, move the results to page one, or improve the load time of no pagination?

 

 

 

var selectedProject;
var selectedProjectId;

$(document).ready(function() {
 $("#yourproject").change(onPrimaryChange);
 $("#yourproject").change();
});

function onPrimaryChange() {
 let list = $("#yourcompany_lookupmodal")
 .find(".entity-lookup")
 .find(".entity-grid")
 .eq(0);

 let list2 = $("#yourproject_lookupmodal")
 .find(".entity-lookup")
 .find(".entity-grid")
 .eq(0);

 // Find the selected row
 var selectedCompany = list2.find("table tbody > tr.selected");

 // Get the value of the desired column
 selectedProject = selectedCompany.find('td[data-attribute="replica_id"]').attr("data-value");
 selectedProjectId = selectedCompany.find('td[data-attribute="Id"]').attr("data-value");

localStorage.setItem("selectedProjectId", selectedProjectId);

 list.on("loaded", function() {
 var projectid = selectedProject;
 console.log("projectid : " + projectid);
 list.find("table tbody > tr").each(function() {
 var tr = $(this);
 var projectidOnly = $(tr).find('td[data-attribute="projectid"]').attr("data-value");
 if (projectidOnly != projectid) {
 tr.remove();
 }
 });
 });

}

 

 

 

 
Categories:
  • HiroakiSasaki Profile Picture
    73 on 07 Mar 2023 at 01:22:43
    Re: Filtered Lookup Modal keeps Empty paginated Pages

    I'm facing with the exactly same issue.

     

    @zuccidevs If you got a solution or workaround by now, I'd appreciate you sharing it here as a solution.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Loading complete