Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

Filtered Lookup Modal keeps Empty paginated Pages

(0) ShareShare
ReportReport
Posted on 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 at
    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

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 >